< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-66.67%50%
ToSearchMode(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchMode.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 SearchModeExtensions
 13    {
 214        public static string ToSerialString(this SearchMode value) => value switch
 215        {
 016            SearchMode.Any => "any",
 417            SearchMode.All => "all",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchMode value.")
 219        };
 20
 21        public static SearchMode ToSearchMode(this string value)
 22        {
 023            if (string.Equals(value, "any", StringComparison.InvariantCultureIgnoreCase)) return SearchMode.Any;
 024            if (string.Equals(value, "all", StringComparison.InvariantCultureIgnoreCase)) return SearchMode.All;
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchMode value.");
 26        }
 27    }
 28}