< Summary

Class:Azure.AI.TextAnalytics.Models.InnerError
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\InnerError.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\InnerError.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\InnerError.cs
Covered lines:24
Uncovered lines:22
Coverable lines:46
Total lines:133
Line coverage:52.1% (24 of 46)
Covered branches:6
Total branches:18
Branch coverage:33.3% (6 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Code()-100%100%
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Message()-100%100%
get_Details()-0%100%
get_Target()-100%100%
get_Innererror()-0%100%
DeserializeInnerError(...)-54.17%42.86%
get_Code()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\InnerError.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;
 9using System.Collections.Generic;
 10using Azure.Core;
 11
 412namespace Azure.AI.TextAnalytics.Models
 13{
 14    /// <summary> The InnerError. </summary>
 15    internal partial class InnerError
 16    {
 17        /// <summary> Initializes a new instance of InnerError. </summary>
 18        /// <param name="code"> Error code. </param>
 19        /// <param name="message"> Error message. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="code"/> or <paramref name="message"/> is null. </ex
 021        internal InnerError(string code, string message)
 22        {
 023            if (code == null)
 24            {
 025                throw new ArgumentNullException(nameof(code));
 26            }
 027            if (message == null)
 28            {
 029                throw new ArgumentNullException(nameof(message));
 30            }
 31
 032            Code = code;
 033            Message = message;
 034            Details = new ChangeTrackingDictionary<string, string>();
 035        }
 36
 37        /// <summary> Initializes a new instance of InnerError. </summary>
 38        /// <param name="code"> Error code. </param>
 39        /// <param name="message"> Error message. </param>
 40        /// <param name="details"> Error details. </param>
 41        /// <param name="target"> Error target. </param>
 42        /// <param name="innererror"> Inner error contains more specific information. </param>
 843        internal InnerError(string code, string message, IReadOnlyDictionary<string, string> details, string target, Inn
 44        {
 845            Code = code;
 846            Message = message;
 847            Details = details;
 848            Target = target;
 849            Innererror = innererror;
 850        }
 51        /// <summary> Error message. </summary>
 852        public string Message { get; }
 53        /// <summary> Error details. </summary>
 054        public IReadOnlyDictionary<string, string> Details { get; }
 55        /// <summary> Error target. </summary>
 856        public string Target { get; }
 57        /// <summary> Inner error contains more specific information. </summary>
 058        public InnerError Innererror { get; }
 59    }
 60}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\InnerError.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.AI.TextAnalytics.Models
 13{
 14    internal partial class InnerError
 15    {
 16        internal static InnerError DeserializeInnerError(JsonElement element)
 17        {
 818            string code = default;
 819            string message = default;
 820            Optional<IReadOnlyDictionary<string, string>> details = default;
 821            Optional<string> target = default;
 822            Optional<InnerError> innererror = default;
 4823            foreach (var property in element.EnumerateObject())
 24            {
 1625                if (property.NameEquals("code"))
 26                {
 827                    code = property.Value.GetString();
 828                    continue;
 29                }
 830                if (property.NameEquals("message"))
 31                {
 832                    message = property.Value.GetString();
 833                    continue;
 34                }
 035                if (property.NameEquals("details"))
 36                {
 037                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 038                    foreach (var property0 in property.Value.EnumerateObject())
 39                    {
 040                        dictionary.Add(property0.Name, property0.Value.GetString());
 41                    }
 042                    details = dictionary;
 043                    continue;
 44                }
 045                if (property.NameEquals("target"))
 46                {
 047                    target = property.Value.GetString();
 048                    continue;
 49                }
 050                if (property.NameEquals("innererror"))
 51                {
 052                    innererror = DeserializeInnerError(property.Value);
 53                    continue;
 54                }
 55            }
 856            return new InnerError(code, message, Optional.ToDictionary(details), target.Value, innererror.Value);
 57        }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\InnerError.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.TextAnalytics.Models
 7{
 8    internal partial class InnerError
 9    {
 10        /// <summary> Error code as string </summary>
 11        [CodeGenMember("Code")]
 412        public string Code { get; }
 13    }
 14}