< Summary

Class:Microsoft.Azure.Search.Models.TokenCharacterKindEnumExtension
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\TokenCharacterKind.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:78
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:18
Branch coverage:0% (0 of 18)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\TokenCharacterKind.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.Search.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 TokenCharacterKind.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum TokenCharacterKind
 23    {
 24        [EnumMember(Value = "letter")]
 25        Letter,
 26        [EnumMember(Value = "digit")]
 27        Digit,
 28        [EnumMember(Value = "whitespace")]
 29        Whitespace,
 30        [EnumMember(Value = "punctuation")]
 31        Punctuation,
 32        [EnumMember(Value = "symbol")]
 33        Symbol
 34    }
 35    internal static class TokenCharacterKindEnumExtension
 36    {
 37        internal static string ToSerializedValue(this TokenCharacterKind? value)
 38        {
 039            return value == null ? null : ((TokenCharacterKind)value).ToSerializedValue();
 40        }
 41
 42        internal static string ToSerializedValue(this TokenCharacterKind value)
 43        {
 44            switch( value )
 45            {
 46                case TokenCharacterKind.Letter:
 047                    return "letter";
 48                case TokenCharacterKind.Digit:
 049                    return "digit";
 50                case TokenCharacterKind.Whitespace:
 051                    return "whitespace";
 52                case TokenCharacterKind.Punctuation:
 053                    return "punctuation";
 54                case TokenCharacterKind.Symbol:
 055                    return "symbol";
 56            }
 057            return null;
 58        }
 59
 60        internal static TokenCharacterKind? ParseTokenCharacterKind(this string value)
 61        {
 62            switch( value )
 63            {
 64                case "letter":
 065                    return TokenCharacterKind.Letter;
 66                case "digit":
 067                    return TokenCharacterKind.Digit;
 68                case "whitespace":
 069                    return TokenCharacterKind.Whitespace;
 70                case "punctuation":
 071                    return TokenCharacterKind.Punctuation;
 72                case "symbol":
 073                    return TokenCharacterKind.Symbol;
 74            }
 075            return null;
 76        }
 77    }
 78}