< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models.OperationStatusCodesEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Vision.ComputerVision
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\OperationStatusCodes.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:72
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:15
Branch coverage:0% (0 of 15)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerializedValue(...)-0%0%
ToSerializedValue(...)-0%0%
ParseOperationStatusCodes(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\OperationStatusCodes.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models
 12{
 13    using Newtonsoft.Json;
 14    using Newtonsoft.Json.Converters;
 15    using System.Runtime;
 16    using System.Runtime.Serialization;
 17
 18    /// <summary>
 19    /// Defines values for OperationStatusCodes.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum OperationStatusCodes
 23    {
 24        [EnumMember(Value = "notStarted")]
 25        NotStarted,
 26        [EnumMember(Value = "running")]
 27        Running,
 28        [EnumMember(Value = "failed")]
 29        Failed,
 30        [EnumMember(Value = "succeeded")]
 31        Succeeded
 32    }
 33    internal static class OperationStatusCodesEnumExtension
 34    {
 35        internal static string ToSerializedValue(this OperationStatusCodes? value)
 36        {
 037            return value == null ? null : ((OperationStatusCodes)value).ToSerializedValue();
 38        }
 39
 40        internal static string ToSerializedValue(this OperationStatusCodes value)
 41        {
 42            switch( value )
 43            {
 44                case OperationStatusCodes.NotStarted:
 045                    return "notStarted";
 46                case OperationStatusCodes.Running:
 047                    return "running";
 48                case OperationStatusCodes.Failed:
 049                    return "failed";
 50                case OperationStatusCodes.Succeeded:
 051                    return "succeeded";
 52            }
 053            return null;
 54        }
 55
 56        internal static OperationStatusCodes? ParseOperationStatusCodes(this string value)
 57        {
 58            switch( value )
 59            {
 60                case "notStarted":
 061                    return OperationStatusCodes.NotStarted;
 62                case "running":
 063                    return OperationStatusCodes.Running;
 64                case "failed":
 065                    return OperationStatusCodes.Failed;
 66                case "succeeded":
 067                    return OperationStatusCodes.Succeeded;
 68            }
 069            return null;
 70        }
 71    }
 72}