< Summary

Class:Azure.AI.FormRecognizer.OperationStatusExtensions
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\OperationStatus.Serialization.cs
Covered lines:4
Uncovered lines:9
Coverable lines:13
Total lines:32
Line coverage:30.7% (4 of 13)
Covered branches:7
Total branches:13
Branch coverage:53.8% (7 of 13)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToOperationStatus(...)-80%87.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\OperationStatus.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.AI.FormRecognizer
 11{
 12    internal static class OperationStatusExtensions
 13    {
 014        public static string ToSerialString(this OperationStatus value) => value switch
 015        {
 016            OperationStatus.NotStarted => "notStarted",
 017            OperationStatus.Running => "running",
 018            OperationStatus.Succeeded => "succeeded",
 019            OperationStatus.Failed => "failed",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value.")
 021        };
 22
 23        public static OperationStatus ToOperationStatus(this string value)
 24        {
 193025            if (string.Equals(value, "notStarted", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.
 88026            if (string.Equals(value, "running", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Run
 32827            if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.S
 3228            if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Fail
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value.");
 30        }
 31    }
 32}