< Summary

Class:Azure.AI.FormRecognizer.Models.FormRecognizerError
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormRecognizerError.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FormRecognizerError.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FormRecognizerError.Serialization.cs
Covered lines:18
Uncovered lines:4
Coverable lines:22
Total lines:96
Line coverage:81.8% (18 of 22)
Covered branches:10
Total branches:14
Branch coverage:71.4% (10 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_ErrorCode()-100%100%
.ctor(...)-60%50%
get_Message()-100%50%
.ctor(...)-75%50%
DeserializeFormRecognizerError(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormRecognizerError.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Azure.Core;
 5
 6namespace Azure.AI.FormRecognizer.Models
 7{
 8    /// <summary>
 9    /// Represents an error that occurred during an operation in the Form Recognizer Azure
 10    /// Cognitive Service.
 11    /// </summary>
 12    [CodeGenModel("ErrorInformation")]
 13    public partial class FormRecognizerError
 14    {
 15        /// <summary>
 16        /// The error code.
 17        /// </summary>
 18        [CodeGenMember("Code")]
 10219        public string ErrorCode { get; }
 20
 2621        /// <summary>
 22        /// The error message.
 023        /// </summary>
 24        [CodeGenMember("Message")]
 9425        public string Message { get; }
 26    }
 027}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FormRecognizerError.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    /// <summary> The ErrorInformation. </summary>
 13    public partial class FormRecognizerError
 14    {
 15        /// <summary> Initializes a new instance of FormRecognizerError. </summary>
 16        /// <param name="errorCode"> . </param>
 17        /// <param name="message"> . </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="errorCode"/> or <paramref name="message"/> is null.
 2619        internal FormRecognizerError(string errorCode, string message)
 20        {
 2621            if (errorCode == null)
 22            {
 023                throw new ArgumentNullException(nameof(errorCode));
 24            }
 2625            if (message == null)
 26            {
 027                throw new ArgumentNullException(nameof(message));
 28            }
 29
 2630            ErrorCode = errorCode;
 2631            Message = message;
 2632        }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\FormRecognizerError.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.AI.FormRecognizer.Models
 12{
 13    public partial class FormRecognizerError
 14    {
 15        internal static FormRecognizerError DeserializeFormRecognizerError(JsonElement element)
 16        {
 5217            string code = default;
 5218            string message = default;
 32819            foreach (var property in element.EnumerateObject())
 20            {
 11221                if (property.NameEquals("code"))
 22                {
 5223                    code = property.Value.GetString();
 5224                    continue;
 25                }
 6026                if (property.NameEquals("message"))
 27                {
 5228                    message = property.Value.GetString();
 29                    continue;
 30                }
 31            }
 5232            return new FormRecognizerError(code, message);
 33        }
 34    }
 35}