< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\TokenCharacterKind.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 TokenCharacterKindExtensions
 13    {
 014        public static string ToSerialString(this TokenCharacterKind value) => value switch
 015        {
 016            TokenCharacterKind.Letter => "letter",
 017            TokenCharacterKind.Digit => "digit",
 018            TokenCharacterKind.Whitespace => "whitespace",
 019            TokenCharacterKind.Punctuation => "punctuation",
 020            TokenCharacterKind.Symbol => "symbol",
 021            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TokenCharacterKind value.")
 022        };
 23
 24        public static TokenCharacterKind ToTokenCharacterKind(this string value)
 25        {
 026            if (string.Equals(value, "letter", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKind.L
 027            if (string.Equals(value, "digit", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKind.Di
 028            if (string.Equals(value, "whitespace", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKi
 029            if (string.Equals(value, "punctuation", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterK
 030            if (string.Equals(value, "symbol", StringComparison.InvariantCultureIgnoreCase)) return TokenCharacterKind.S
 031            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TokenCharacterKind value.");
 32        }
 33    }
 34}