< Summary

Class:Azure.AI.TextAnalytics.Models.DetectedLanguage_internal
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DetectedLanguage_internal.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DetectedLanguage_internal.Serialization.cs
Covered lines:22
Uncovered lines:2
Coverable lines:24
Total lines:84
Line coverage:91.6% (22 of 24)
Covered branches:10
Total branches:12
Branch coverage:83.3% (10 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
get_Name()-100%100%
get_Iso6391Name()-100%100%
get_ConfidenceScore()-100%100%
DeserializeDetectedLanguage_internal(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DetectedLanguage_internal.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 DetectedLanguage. </summary>
 13    internal readonly partial struct DetectedLanguage_internal
 14    {
 15        /// <summary> Initializes a new instance of DetectedLanguage_internal. </summary>
 16        /// <param name="name"> Long name of a detected language (e.g. English, French). </param>
 17        /// <param name="iso6391Name"> A two letter representation of the detected language according to the ISO 639-1 s
 18        /// <param name="confidenceScore"> A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="iso6391Name"/> is null. 
 20        internal DetectedLanguage_internal(string name, string iso6391Name, double confidenceScore)
 21        {
 8422            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 8426            if (iso6391Name == null)
 27            {
 028                throw new ArgumentNullException(nameof(iso6391Name));
 29            }
 30
 8431            Name = name;
 8432            Iso6391Name = iso6391Name;
 8433            ConfidenceScore = confidenceScore;
 8434        }
 35
 36        /// <summary> Long name of a detected language (e.g. English, French). </summary>
 8437        public string Name { get; }
 38        /// <summary> A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en,
 8439        public string Iso6391Name { get; }
 40        /// <summary> A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified 
 8441        public double ConfidenceScore { get; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DetectedLanguage_internal.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 struct DetectedLanguage_internal
 14    {
 15        internal static DetectedLanguage_internal DeserializeDetectedLanguage_internal(JsonElement element)
 16        {
 8417            string name = default;
 8418            string iso6391Name = default;
 8419            double confidenceScore = default;
 67220            foreach (var property in element.EnumerateObject())
 21            {
 25222                if (property.NameEquals("name"))
 23                {
 8424                    name = property.Value.GetString();
 8425                    continue;
 26                }
 16827                if (property.NameEquals("iso6391Name"))
 28                {
 8429                    iso6391Name = property.Value.GetString();
 8430                    continue;
 31                }
 8432                if (property.NameEquals("confidenceScore"))
 33                {
 8434                    confidenceScore = property.Value.GetDouble();
 35                    continue;
 36                }
 37            }
 8438            return new DetectedLanguage_internal(name, iso6391Name, confidenceScore);
 39        }
 40    }
 41}