< Summary

Class:Azure.AI.TextAnalytics.RecognizeEntitiesResult
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\RecognizeEntitiesResult.cs
Covered lines:7
Uncovered lines:0
Coverable lines:7
Total lines:42
Line coverage:100% (7 of 7)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
get_Entities()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\RecognizeEntitiesResult.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5
 6namespace Azure.AI.TextAnalytics
 7{
 8    /// <summary>
 9    /// The result of the recognize entities operation on a document,
 10    /// containing a collection of the <see cref="CategorizedEntity"/> objects
 11    /// identified in that document.
 12    /// </summary>
 13    public class RecognizeEntitiesResult : TextAnalyticsResult
 14    {
 15        private readonly CategorizedEntityCollection _entities;
 16
 17        internal RecognizeEntitiesResult(string id, TextDocumentStatistics statistics, CategorizedEntityCollection entit
 8418            : base(id, statistics)
 19        {
 8420            _entities = entities;
 8421        }
 22
 4023        internal RecognizeEntitiesResult(string id, TextAnalyticsError error) : base(id, error) { }
 24
 25        /// <summary>
 26        /// Gets the collection of named entities identified in the document.
 27        /// </summary>
 28        public CategorizedEntityCollection Entities
 29        {
 30            get
 31            {
 8832                if (HasError)
 33                {
 34#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations
 435                    throw new InvalidOperationException($"Cannot access result for document {Id}, due to error {Error.Er
 36#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations
 37                }
 8438                return _entities;
 39            }
 40        }
 41    }
 42}

Methods/Properties

.ctor(...)
.ctor(...)
get_Entities()