< Summary

Class:Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Models.TrainingStatusEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Authoring\src\Generated\Models\TrainingStatus.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:66
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Authoring\src\Generated\Models\TrainingStatus.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.Language.LUIS.Authoring.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 TrainingStatus.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum TrainingStatus
 23    {
 24        [EnumMember(Value = "NeedsTraining")]
 25        NeedsTraining,
 26        [EnumMember(Value = "InProgress")]
 27        InProgress,
 28        [EnumMember(Value = "Trained")]
 29        Trained
 30    }
 31    internal static class TrainingStatusEnumExtension
 32    {
 33        internal static string ToSerializedValue(this TrainingStatus? value)
 34        {
 035            return value == null ? null : ((TrainingStatus)value).ToSerializedValue();
 36        }
 37
 38        internal static string ToSerializedValue(this TrainingStatus value)
 39        {
 40            switch( value )
 41            {
 42                case TrainingStatus.NeedsTraining:
 043                    return "NeedsTraining";
 44                case TrainingStatus.InProgress:
 045                    return "InProgress";
 46                case TrainingStatus.Trained:
 047                    return "Trained";
 48            }
 049            return null;
 50        }
 51
 52        internal static TrainingStatus? ParseTrainingStatus(this string value)
 53        {
 54            switch( value )
 55            {
 56                case "NeedsTraining":
 057                    return TrainingStatus.NeedsTraining;
 58                case "InProgress":
 059                    return TrainingStatus.InProgress;
 60                case "Trained":
 061                    return TrainingStatus.Trained;
 62            }
 063            return null;
 64        }
 65    }
 66}