< Summary

Class:Azure.Search.Documents.Models.AutocompleteModeExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AutocompleteMode.Serialization.cs
Covered lines:6
Uncovered lines:5
Coverable lines:11
Total lines:30
Line coverage:54.5% (6 of 11)
Covered branches:3
Total branches:10
Branch coverage:30% (3 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-85.71%75%
ToAutocompleteMode(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AutocompleteMode.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.Models
 11{
 12    internal static class AutocompleteModeExtensions
 13    {
 3214        public static string ToSerialString(this AutocompleteMode value) => value switch
 3215        {
 5616            AutocompleteMode.OneTerm => "oneTerm",
 3617            AutocompleteMode.TwoTerms => "twoTerms",
 3618            AutocompleteMode.OneTermWithContext => "oneTermWithContext",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutocompleteMode value.")
 3220        };
 21
 22        public static AutocompleteMode ToAutocompleteMode(this string value)
 23        {
 024            if (string.Equals(value, "oneTerm", StringComparison.InvariantCultureIgnoreCase)) return AutocompleteMode.On
 025            if (string.Equals(value, "twoTerms", StringComparison.InvariantCultureIgnoreCase)) return AutocompleteMode.T
 026            if (string.Equals(value, "oneTermWithContext", StringComparison.InvariantCultureIgnoreCase)) return Autocomp
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutocompleteMode value.");
 28        }
 29    }
 30}