< Summary

Class:Microsoft.Azure.Search.Models.PhoneticEncoderEnumExtension
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\PhoneticEncoder.cs
Covered lines:0
Uncovered lines:25
Coverable lines:25
Total lines:114
Line coverage:0% (0 of 25)
Covered branches:0
Total branches:64
Branch coverage:0% (0 of 64)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\PhoneticEncoder.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 PhoneticEncoder.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum PhoneticEncoder
 23    {
 24        [EnumMember(Value = "metaphone")]
 25        Metaphone,
 26        [EnumMember(Value = "doubleMetaphone")]
 27        DoubleMetaphone,
 28        [EnumMember(Value = "soundex")]
 29        Soundex,
 30        [EnumMember(Value = "refinedSoundex")]
 31        RefinedSoundex,
 32        [EnumMember(Value = "caverphone1")]
 33        Caverphone1,
 34        [EnumMember(Value = "caverphone2")]
 35        Caverphone2,
 36        [EnumMember(Value = "cologne")]
 37        Cologne,
 38        [EnumMember(Value = "nysiis")]
 39        Nysiis,
 40        [EnumMember(Value = "koelnerPhonetik")]
 41        KoelnerPhonetik,
 42        [EnumMember(Value = "haasePhonetik")]
 43        HaasePhonetik,
 44        [EnumMember(Value = "beiderMorse")]
 45        BeiderMorse
 46    }
 47    internal static class PhoneticEncoderEnumExtension
 48    {
 49        internal static string ToSerializedValue(this PhoneticEncoder? value)
 50        {
 051            return value == null ? null : ((PhoneticEncoder)value).ToSerializedValue();
 52        }
 53
 54        internal static string ToSerializedValue(this PhoneticEncoder value)
 55        {
 56            switch( value )
 57            {
 58                case PhoneticEncoder.Metaphone:
 059                    return "metaphone";
 60                case PhoneticEncoder.DoubleMetaphone:
 061                    return "doubleMetaphone";
 62                case PhoneticEncoder.Soundex:
 063                    return "soundex";
 64                case PhoneticEncoder.RefinedSoundex:
 065                    return "refinedSoundex";
 66                case PhoneticEncoder.Caverphone1:
 067                    return "caverphone1";
 68                case PhoneticEncoder.Caverphone2:
 069                    return "caverphone2";
 70                case PhoneticEncoder.Cologne:
 071                    return "cologne";
 72                case PhoneticEncoder.Nysiis:
 073                    return "nysiis";
 74                case PhoneticEncoder.KoelnerPhonetik:
 075                    return "koelnerPhonetik";
 76                case PhoneticEncoder.HaasePhonetik:
 077                    return "haasePhonetik";
 78                case PhoneticEncoder.BeiderMorse:
 079                    return "beiderMorse";
 80            }
 081            return null;
 82        }
 83
 84        internal static PhoneticEncoder? ParsePhoneticEncoder(this string value)
 85        {
 86            switch( value )
 87            {
 88                case "metaphone":
 089                    return PhoneticEncoder.Metaphone;
 90                case "doubleMetaphone":
 091                    return PhoneticEncoder.DoubleMetaphone;
 92                case "soundex":
 093                    return PhoneticEncoder.Soundex;
 94                case "refinedSoundex":
 095                    return PhoneticEncoder.RefinedSoundex;
 96                case "caverphone1":
 097                    return PhoneticEncoder.Caverphone1;
 98                case "caverphone2":
 099                    return PhoneticEncoder.Caverphone2;
 100                case "cologne":
 0101                    return PhoneticEncoder.Cologne;
 102                case "nysiis":
 0103                    return PhoneticEncoder.Nysiis;
 104                case "koelnerPhonetik":
 0105                    return PhoneticEncoder.KoelnerPhonetik;
 106                case "haasePhonetik":
 0107                    return PhoneticEncoder.HaasePhonetik;
 108                case "beiderMorse":
 0109                    return PhoneticEncoder.BeiderMorse;
 110            }
 0111            return null;
 112        }
 113    }
 114}