< Summary

Class:Azure.AI.FormRecognizer.Models.FieldValueTypeExtensions
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FieldValueType.Serialization.cs
Covered lines:7
Uncovered lines:14
Coverable lines:21
Total lines:40
Line coverage:33.3% (7 of 21)
Covered branches:14
Total branches:25
Branch coverage:56% (14 of 25)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToFieldValueType(...)-77.78%87.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FieldValueType.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.Models
 11{
 12    internal static class FieldValueTypeExtensions
 13    {
 014        public static string ToSerialString(this FieldValueType value) => value switch
 015        {
 016            FieldValueType.String => "string",
 017            FieldValueType.Date => "date",
 018            FieldValueType.Time => "time",
 019            FieldValueType.PhoneNumber => "phoneNumber",
 020            FieldValueType.Float => "number",
 021            FieldValueType.Int64 => "integer",
 022            FieldValueType.List => "array",
 023            FieldValueType.Dictionary => "object",
 024            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FieldValueType value.")
 025        };
 26
 27        public static FieldValueType ToFieldValueType(this string value)
 28        {
 129229            if (string.Equals(value, "string", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.Strin
 31630            if (string.Equals(value, "date", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.Date;
 30031            if (string.Equals(value, "time", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.Time;
 29232            if (string.Equals(value, "phoneNumber", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.
 41233            if (string.Equals(value, "number", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.Float
 034            if (string.Equals(value, "integer", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.Int6
 10035            if (string.Equals(value, "array", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.List;
 10436            if (string.Equals(value, "object", StringComparison.InvariantCultureIgnoreCase)) return FieldValueType.Dicti
 037            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FieldValueType value.");
 38        }
 39    }
 40}