< Summary

Class:Azure.AI.TextAnalytics.Models.DocumentError
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DocumentError.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DocumentError.Serialization.cs
Covered lines:17
Uncovered lines:2
Coverable lines:19
Total lines:74
Line coverage:89.4% (17 of 19)
Covered branches:8
Total branches:10
Branch coverage:80% (8 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
get_Id()-100%100%
get_Error()-100%100%
DeserializeDocumentError(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DocumentError.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.TextAnalytics.Models
 11{
 12    /// <summary> The DocumentError. </summary>
 13    internal partial class DocumentError
 14    {
 15        /// <summary> Initializes a new instance of DocumentError. </summary>
 16        /// <param name="id"> Document Id. </param>
 17        /// <param name="error"> Document Error. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="id"/> or <paramref name="error"/> is null. </except
 819        internal DocumentError(string id, TextAnalyticsError_internal error)
 20        {
 821            if (id == null)
 22            {
 023                throw new ArgumentNullException(nameof(id));
 24            }
 825            if (error == null)
 26            {
 027                throw new ArgumentNullException(nameof(error));
 28            }
 29
 830            Id = id;
 831            Error = error;
 832        }
 33
 34        /// <summary> Document Id. </summary>
 435        public string Id { get; }
 36        /// <summary> Document Error. </summary>
 837        public TextAnalyticsError_internal Error { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DocumentError.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.TextAnalytics.Models
 12{
 13    internal partial class DocumentError
 14    {
 15        internal static DocumentError DeserializeDocumentError(JsonElement element)
 16        {
 817            string id = default;
 818            TextAnalyticsError_internal error = default;
 4819            foreach (var property in element.EnumerateObject())
 20            {
 1621                if (property.NameEquals("id"))
 22                {
 823                    id = property.Value.GetString();
 824                    continue;
 25                }
 826                if (property.NameEquals("error"))
 27                {
 828                    error = TextAnalyticsError_internal.DeserializeTextAnalyticsError_internal(property.Value);
 29                    continue;
 30                }
 31            }
 832            return new DocumentError(id, error);
 33        }
 34    }
 35}