< Summary

Class:Azure.Search.Documents.Models.SearchQueryTypeExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchQueryType.Serialization.cs
Covered lines:5
Uncovered lines:4
Coverable lines:9
Total lines:28
Line coverage:55.5% (5 of 9)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-83.33%75%
ToSearchQueryType(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchQueryType.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 SearchQueryTypeExtensions
 13    {
 1014        public static string ToSerialString(this SearchQueryType value) => value switch
 1015        {
 1216            SearchQueryType.Simple => "simple",
 1817            SearchQueryType.Full => "full",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchQueryType value.")
 1019        };
 20
 21        public static SearchQueryType ToSearchQueryType(this string value)
 22        {
 023            if (string.Equals(value, "simple", StringComparison.InvariantCultureIgnoreCase)) return SearchQueryType.Simp
 024            if (string.Equals(value, "full", StringComparison.InvariantCultureIgnoreCase)) return SearchQueryType.Full;
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchQueryType value.");
 26        }
 27    }
 28}