< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-44.44%16.67%
ToScoringFunctionAggregation(...)-16.67%10%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ScoringFunctionAggregation.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 ScoringFunctionAggregationExtensions
 13    {
 614        public static string ToSerialString(this ScoringFunctionAggregation value) => value switch
 615        {
 1216            ScoringFunctionAggregation.Sum => "sum",
 017            ScoringFunctionAggregation.Average => "average",
 018            ScoringFunctionAggregation.Minimum => "minimum",
 019            ScoringFunctionAggregation.Maximum => "maximum",
 020            ScoringFunctionAggregation.FirstMatching => "firstMatching",
 021            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionAggregation value."
 622        };
 23
 24        public static ScoringFunctionAggregation ToScoringFunctionAggregation(this string value)
 25        {
 2026            if (string.Equals(value, "sum", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggregat
 027            if (string.Equals(value, "average", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggr
 028            if (string.Equals(value, "minimum", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggr
 029            if (string.Equals(value, "maximum", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggr
 030            if (string.Equals(value, "firstMatching", StringComparison.InvariantCultureIgnoreCase)) return ScoringFuncti
 031            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionAggregation value.");
 32        }
 33    }
 34}