< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.VideoLengthEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\VideoLength.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:68
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%
ParseVideoLength(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\VideoLength.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models
 8{
 9    using Newtonsoft.Json;
 10    using Newtonsoft.Json.Converters;
 11    using System.Runtime;
 12    using System.Runtime.Serialization;
 13
 14    /// <summary>
 15    /// Defines values for VideoLength.
 16    /// </summary>
 17    [JsonConverter(typeof(StringEnumConverter))]
 18    public enum VideoLength
 19    {
 20        [EnumMember(Value = "All")]
 21        All,
 22        [EnumMember(Value = "Short")]
 23        Short,
 24        [EnumMember(Value = "Medium")]
 25        Medium,
 26        [EnumMember(Value = "Long")]
 27        Long
 28    }
 29    internal static class VideoLengthEnumExtension
 30    {
 31        internal static string ToSerializedValue(this VideoLength? value)
 32        {
 033            return value == null ? null : ((VideoLength)value).ToSerializedValue();
 34        }
 35
 36        internal static string ToSerializedValue(this VideoLength value)
 37        {
 38            switch( value )
 39            {
 40                case VideoLength.All:
 041                    return "All";
 42                case VideoLength.Short:
 043                    return "Short";
 44                case VideoLength.Medium:
 045                    return "Medium";
 46                case VideoLength.Long:
 047                    return "Long";
 48            }
 049            return null;
 50        }
 51
 52        internal static VideoLength? ParseVideoLength(this string value)
 53        {
 54            switch( value )
 55            {
 56                case "All":
 057                    return VideoLength.All;
 58                case "Short":
 059                    return VideoLength.Short;
 60                case "Medium":
 061                    return VideoLength.Medium;
 62                case "Long":
 063                    return VideoLength.Long;
 64            }
 065            return null;
 66        }
 67    }
 68}