< Summary

Class:Azure.Search.Documents.Indexes.Models.PhoneticEncoderExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\PhoneticEncoder.Serialization.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:46
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:34
Branch coverage:0% (0 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToPhoneticEncoder(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\PhoneticEncoder.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.Search.Documents.Indexes.Models
 11{
 12    internal static class PhoneticEncoderExtensions
 13    {
 014        public static string ToSerialString(this PhoneticEncoder value) => value switch
 015        {
 016            PhoneticEncoder.Metaphone => "metaphone",
 017            PhoneticEncoder.DoubleMetaphone => "doubleMetaphone",
 018            PhoneticEncoder.Soundex => "soundex",
 019            PhoneticEncoder.RefinedSoundex => "refinedSoundex",
 020            PhoneticEncoder.Caverphone1 => "caverphone1",
 021            PhoneticEncoder.Caverphone2 => "caverphone2",
 022            PhoneticEncoder.Cologne => "cologne",
 023            PhoneticEncoder.Nysiis => "nysiis",
 024            PhoneticEncoder.KoelnerPhonetik => "koelnerPhonetik",
 025            PhoneticEncoder.HaasePhonetik => "haasePhonetik",
 026            PhoneticEncoder.BeiderMorse => "beiderMorse",
 027            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PhoneticEncoder value.")
 028        };
 29
 30        public static PhoneticEncoder ToPhoneticEncoder(this string value)
 31        {
 032            if (string.Equals(value, "metaphone", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.M
 033            if (string.Equals(value, "doubleMetaphone", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEnc
 034            if (string.Equals(value, "soundex", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.Sou
 035            if (string.Equals(value, "refinedSoundex", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEnco
 036            if (string.Equals(value, "caverphone1", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder
 037            if (string.Equals(value, "caverphone2", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder
 038            if (string.Equals(value, "cologne", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.Col
 039            if (string.Equals(value, "nysiis", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder.Nysi
 040            if (string.Equals(value, "koelnerPhonetik", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEnc
 041            if (string.Equals(value, "haasePhonetik", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncod
 042            if (string.Equals(value, "beiderMorse", StringComparison.InvariantCultureIgnoreCase)) return PhoneticEncoder
 043            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PhoneticEncoder value.");
 44        }
 45    }
 46}