< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FormContentType.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 FormContentTypeExtensions
 13    {
 14814        public static string ToSerialString(this FormContentType value) => value switch
 14815        {
 23616            FormContentType.Pdf => "application/pdf",
 19217            FormContentType.Jpeg => "image/jpeg",
 15218            FormContentType.Png => "image/png",
 16019            FormContentType.Tiff => "image/tiff",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FormContentType value.")
 14821        };
 22
 23        public static FormContentType ToFormContentType(this string value)
 24        {
 025            if (string.Equals(value, "application/pdf", StringComparison.InvariantCultureIgnoreCase)) return FormContent
 026            if (string.Equals(value, "image/jpeg", StringComparison.InvariantCultureIgnoreCase)) return FormContentType.
 027            if (string.Equals(value, "image/png", StringComparison.InvariantCultureIgnoreCase)) return FormContentType.P
 028            if (string.Equals(value, "image/tiff", StringComparison.InvariantCultureIgnoreCase)) return FormContentType.
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FormContentType value.");
 30        }
 31    }
 32}