< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.TextFormatEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TextFormat.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:56
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TextFormat.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 TextFormat.
 16    /// </summary>
 17    [JsonConverter(typeof(StringEnumConverter))]
 18    public enum TextFormat
 19    {
 20        [EnumMember(Value = "Raw")]
 21        Raw,
 22        [EnumMember(Value = "Html")]
 23        Html
 24    }
 25    internal static class TextFormatEnumExtension
 26    {
 27        internal static string ToSerializedValue(this TextFormat? value)
 28        {
 029            return value == null ? null : ((TextFormat)value).ToSerializedValue();
 30        }
 31
 32        internal static string ToSerializedValue(this TextFormat value)
 33        {
 34            switch( value )
 35            {
 36                case TextFormat.Raw:
 037                    return "Raw";
 38                case TextFormat.Html:
 039                    return "Html";
 40            }
 041            return null;
 42        }
 43
 44        internal static TextFormat? ParseTextFormat(this string value)
 45        {
 46            switch( value )
 47            {
 48                case "Raw":
 049                    return TextFormat.Raw;
 50                case "Html":
 051                    return TextFormat.Html;
 52            }
 053            return null;
 54        }
 55    }
 56}