< Summary

Class:Azure.Search.Documents.Indexes.Models.ScoringFunctionInterpolationExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ScoringFunctionInterpolation.Serialization.cs
Covered lines:5
Uncovered lines:8
Coverable lines:13
Total lines:32
Line coverage:38.4% (5 of 13)
Covered branches:2
Total branches:13
Branch coverage:15.3% (2 of 13)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-50%20%
ToScoringFunctionInterpolation(...)-20%12.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ScoringFunctionInterpolation.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 ScoringFunctionInterpolationExtensions
 13    {
 214        public static string ToSerialString(this ScoringFunctionInterpolation value) => value switch
 215        {
 416            ScoringFunctionInterpolation.Linear => "linear",
 017            ScoringFunctionInterpolation.Constant => "constant",
 018            ScoringFunctionInterpolation.Quadratic => "quadratic",
 019            ScoringFunctionInterpolation.Logarithmic => "logarithmic",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionInterpolation value
 221        };
 22
 23        public static ScoringFunctionInterpolation ToScoringFunctionInterpolation(this string value)
 24        {
 2025            if (string.Equals(value, "linear", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionInter
 026            if (string.Equals(value, "constant", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionInt
 027            if (string.Equals(value, "quadratic", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionIn
 028            if (string.Equals(value, "logarithmic", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunction
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionInterpolation value.");
 30        }
 31    }
 32}