< Summary

Class:Azure.AI.FormRecognizer.Models.AnalyzeResult
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeResult.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeResult.Serialization.cs
Covered lines:53
Uncovered lines:10
Coverable lines:63
Total lines:149
Line coverage:84.1% (53 of 63)
Covered branches:26
Total branches:28
Branch coverage:92.8% (26 of 28)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Version()-0%100%
get_ReadResults()-100%100%
get_PageResults()-100%100%
get_DocumentResults()-100%100%
get_Errors()-100%100%
DeserializeAnalyzeResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeResult.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
 12namespace Azure.AI.FormRecognizer.Models
 13{
 14    /// <summary> Analyze operation result. </summary>
 15    internal partial class AnalyzeResult
 16    {
 17        /// <summary> Initializes a new instance of AnalyzeResult. </summary>
 18        /// <param name="version"> Version of schema used for this result. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="version"/> is null. </exception>
 020        internal AnalyzeResult(string version)
 21        {
 022            if (version == null)
 23            {
 024                throw new ArgumentNullException(nameof(version));
 25            }
 26
 027            Version = version;
 028            ReadResults = new ChangeTrackingList<ReadResult>();
 029            PageResults = new ChangeTrackingList<PageResult>();
 030            DocumentResults = new ChangeTrackingList<DocumentResult>();
 031            Errors = new ChangeTrackingList<FormRecognizerError>();
 032        }
 33
 34        /// <summary> Initializes a new instance of AnalyzeResult. </summary>
 35        /// <param name="version"> Version of schema used for this result. </param>
 36        /// <param name="readResults"> Text extracted from the input. </param>
 37        /// <param name="pageResults"> Page-level information extracted from the input. </param>
 38        /// <param name="documentResults"> Document-level information extracted from the input. </param>
 39        /// <param name="errors"> List of errors reported during the analyze operation. </param>
 16040        internal AnalyzeResult(string version, IReadOnlyList<ReadResult> readResults, IReadOnlyList<PageResult> pageResu
 41        {
 16042            Version = version;
 16043            ReadResults = readResults;
 16044            PageResults = pageResults;
 16045            DocumentResults = documentResults;
 16046            Errors = errors;
 16047        }
 48
 49        /// <summary> Version of schema used for this result. </summary>
 050        public string Version { get; }
 51        /// <summary> Text extracted from the input. </summary>
 17652        public IReadOnlyList<ReadResult> ReadResults { get; }
 53        /// <summary> Page-level information extracted from the input. </summary>
 25254        public IReadOnlyList<PageResult> PageResults { get; }
 55        /// <summary> Document-level information extracted from the input. </summary>
 25256        public IReadOnlyList<DocumentResult> DocumentResults { get; }
 57        /// <summary> List of errors reported during the analyze operation. </summary>
 1258        public IReadOnlyList<FormRecognizerError> Errors { get; }
 59    }
 60}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\AnalyzeResult.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.FormRecognizer.Models
 13{
 14    internal partial class AnalyzeResult
 15    {
 16        internal static AnalyzeResult DeserializeAnalyzeResult(JsonElement element)
 17        {
 16018            string version = default;
 16019            Optional<IReadOnlyList<ReadResult>> readResults = default;
 16020            Optional<IReadOnlyList<PageResult>> pageResults = default;
 16021            Optional<IReadOnlyList<DocumentResult>> documentResults = default;
 16022            Optional<IReadOnlyList<FormRecognizerError>> errors = default;
 159223            foreach (var property in element.EnumerateObject())
 24            {
 63625                if (property.NameEquals("version"))
 26                {
 16027                    version = property.Value.GetString();
 16028                    continue;
 29                }
 47630                if (property.NameEquals("readResults"))
 31                {
 15632                    if (property.Value.ValueKind == JsonValueKind.Null)
 33                    {
 434                        readResults = null;
 435                        continue;
 36                    }
 15237                    List<ReadResult> array = new List<ReadResult>();
 73638                    foreach (var item in property.Value.EnumerateArray())
 39                    {
 21640                        array.Add(ReadResult.DeserializeReadResult(item));
 41                    }
 15242                    readResults = array;
 15243                    continue;
 44                }
 32045                if (property.NameEquals("pageResults"))
 46                {
 12047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 449                        pageResults = null;
 450                        continue;
 51                    }
 11652                    List<PageResult> array = new List<PageResult>();
 56053                    foreach (var item in property.Value.EnumerateArray())
 54                    {
 16455                        array.Add(PageResult.DeserializePageResult(item));
 56                    }
 11657                    pageResults = array;
 11658                    continue;
 59                }
 20060                if (property.NameEquals("documentResults"))
 61                {
 11662                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 464                        documentResults = null;
 465                        continue;
 66                    }
 11267                    List<DocumentResult> array = new List<DocumentResult>();
 40868                    foreach (var item in property.Value.EnumerateArray())
 69                    {
 9270                        array.Add(DocumentResult.DeserializeDocumentResult(item));
 71                    }
 11272                    documentResults = array;
 11273                    continue;
 74                }
 8475                if (property.NameEquals("errors"))
 76                {
 8477                    List<FormRecognizerError> array = new List<FormRecognizerError>();
 19278                    foreach (var item in property.Value.EnumerateArray())
 79                    {
 1280                        array.Add(FormRecognizerError.DeserializeFormRecognizerError(item));
 81                    }
 8482                    errors = array;
 83                    continue;
 84                }
 85            }
 16086            return new AnalyzeResult(version, Optional.ToList(readResults), Optional.ToList(pageResults), Optional.ToLis
 87        }
 88    }
 89}