< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
DeserializeTextDocumentStatistics(...)-100%100%
.ctor(...)-100%100%
get_CharacterCount()-100%100%
get_TransactionCount()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\TextDocumentStatistics.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
 12{
 13    public partial struct TextDocumentStatistics
 14    {
 15        internal static TextDocumentStatistics DeserializeTextDocumentStatistics(JsonElement element)
 16        {
 2417            int charactersCount = default;
 2418            int transactionsCount = default;
 14419            foreach (var property in element.EnumerateObject())
 20            {
 4821                if (property.NameEquals("charactersCount"))
 22                {
 2423                    charactersCount = property.Value.GetInt32();
 2424                    continue;
 25                }
 2426                if (property.NameEquals("transactionsCount"))
 27                {
 2428                    transactionsCount = property.Value.GetInt32();
 29                    continue;
 30                }
 31            }
 2432            return new TextDocumentStatistics(charactersCount, transactionsCount);
 33        }
 34    }
 35}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\TextDocumentStatistics.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
 7{
 8    /// <summary>
 9    /// A collection of statistics describing an individual input document.
 10    /// This information is provided on the result collection returned by an
 11    /// operation when the caller passes in a <see cref="TextAnalyticsRequestOptions"/>
 12    /// with IncludeStatistics set to true.
 13    /// </summary>
 14    [CodeGenModel("DocumentStatistics")]
 15    public readonly partial struct TextDocumentStatistics
 16    {
 17        internal TextDocumentStatistics(int characterCount, int transactionCount)
 18        {
 8819            CharacterCount = characterCount;
 8820            TransactionCount = transactionCount;
 8821        }
 22
 23        /// <summary>
 24        /// Gets the number of characters (in Unicode graphemes) the corresponding document contains.
 25        /// </summary>
 26        [CodeGenMember("CharactersCount")]
 1227        public int CharacterCount { get; }
 28
 29        /// <summary>
 30        /// Gets the number of transactions used by the service to analyze the
 31        /// input document.
 32        /// </summary>
 33        [CodeGenMember("TransactionsCount")]
 1234        public int TransactionCount { get; }
 35    }
 36}