< Summary

Class:Azure.AI.TextAnalytics.Models.Match
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\Match.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\Match.Serialization.cs
Covered lines:0
Uncovered lines:29
Coverable lines:29
Total lines:90
Line coverage:0% (0 of 29)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_ConfidenceScore()-0%100%
get_Text()-0%100%
get_Offset()-0%100%
get_Length()-0%100%
DeserializeMatch(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\Match.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 Match. </summary>
 13    internal partial class Match
 14    {
 15        /// <summary> Initializes a new instance of Match. </summary>
 16        /// <param name="confidenceScore"> If a well-known item is recognized, a decimal number denoting the confidence 
 17        /// <param name="text"> Entity text as appears in the request. </param>
 18        /// <param name="offset"> Start position for the entity match text. </param>
 19        /// <param name="length"> Length for the entity match text. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="text"/> is null. </exception>
 021        internal Match(double confidenceScore, string text, int offset, int length)
 22        {
 023            if (text == null)
 24            {
 025                throw new ArgumentNullException(nameof(text));
 26            }
 27
 028            ConfidenceScore = confidenceScore;
 029            Text = text;
 030            Offset = offset;
 031            Length = length;
 032        }
 33
 34        /// <summary> If a well-known item is recognized, a decimal number denoting the confidence level between 0 and 1
 035        public double ConfidenceScore { get; }
 36        /// <summary> Entity text as appears in the request. </summary>
 037        public string Text { get; }
 38        /// <summary> Start position for the entity match text. </summary>
 039        public int Offset { get; }
 40        /// <summary> Length for the entity match text. </summary>
 041        public int Length { get; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\Match.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 Match
 14    {
 15        internal static Match DeserializeMatch(JsonElement element)
 16        {
 017            double confidenceScore = default;
 018            string text = default;
 019            int offset = default;
 020            int length = default;
 021            foreach (var property in element.EnumerateObject())
 22            {
 023                if (property.NameEquals("confidenceScore"))
 24                {
 025                    confidenceScore = property.Value.GetDouble();
 026                    continue;
 27                }
 028                if (property.NameEquals("text"))
 29                {
 030                    text = property.Value.GetString();
 031                    continue;
 32                }
 033                if (property.NameEquals("offset"))
 34                {
 035                    offset = property.Value.GetInt32();
 036                    continue;
 37                }
 038                if (property.NameEquals("length"))
 39                {
 040                    length = property.Value.GetInt32();
 41                    continue;
 42                }
 43            }
 044            return new Match(confidenceScore, text, offset, length);
 45        }
 46    }
 47}