< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToIndexerExecutionStatus(...)-20%25%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerExecutionStatus.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 IndexerExecutionStatusExtensions
 13    {
 014        public static string ToSerialString(this IndexerExecutionStatus value) => value switch
 015        {
 016            IndexerExecutionStatus.TransientFailure => "transientFailure",
 017            IndexerExecutionStatus.Success => "success",
 018            IndexerExecutionStatus.InProgress => "inProgress",
 019            IndexerExecutionStatus.Reset => "reset",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexerExecutionStatus value.")
 021        };
 22
 23        public static IndexerExecutionStatus ToIndexerExecutionStatus(this string value)
 24        {
 025            if (string.Equals(value, "transientFailure", StringComparison.InvariantCultureIgnoreCase)) return IndexerExe
 2426            if (string.Equals(value, "success", StringComparison.InvariantCultureIgnoreCase)) return IndexerExecutionSta
 027            if (string.Equals(value, "inProgress", StringComparison.InvariantCultureIgnoreCase)) return IndexerExecution
 028            if (string.Equals(value, "reset", StringComparison.InvariantCultureIgnoreCase)) return IndexerExecutionStatu
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexerExecutionStatus value.");
 30        }
 31    }
 32}