< Summary

Class:Azure.Search.Documents.Indexes.Models.IndexerStatusExtensions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerStatus.Serialization.cs
Covered lines:1
Uncovered lines:10
Coverable lines:11
Total lines:30
Line coverage:9% (1 of 11)
Covered branches:3
Total branches:10
Branch coverage:30% (3 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToIndexerStatus(...)-25%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerStatus.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 IndexerStatusExtensions
 13    {
 014        public static string ToSerialString(this IndexerStatus value) => value switch
 015        {
 016            IndexerStatus.Unknown => "unknown",
 017            IndexerStatus.Error => "error",
 018            IndexerStatus.Running => "running",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexerStatus value.")
 020        };
 21
 22        public static IndexerStatus ToIndexerStatus(this string value)
 23        {
 024            if (string.Equals(value, "unknown", StringComparison.InvariantCultureIgnoreCase)) return IndexerStatus.Unkno
 025            if (string.Equals(value, "error", StringComparison.InvariantCultureIgnoreCase)) return IndexerStatus.Error;
 1026            if (string.Equals(value, "running", StringComparison.InvariantCultureIgnoreCase)) return IndexerStatus.Runni
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexerStatus value.");
 28        }
 29    }
 30}