< Summary

Class:Azure.AI.FormRecognizer.Models.PageResult
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\PageResult.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\PageResult.Serialization.cs
Covered lines:36
Uncovered lines:5
Coverable lines:41
Total lines:110
Line coverage:87.8% (36 of 41)
Covered branches:16
Total branches:16
Branch coverage:100% (16 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Page()-100%100%
get_ClusterId()-100%100%
get_KeyValuePairs()-100%100%
get_Tables()-100%100%
DeserializePageResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\PageResult.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 Azure.Core;
 10
 11namespace Azure.AI.FormRecognizer.Models
 12{
 13    /// <summary> Extracted information from a single page. </summary>
 14    internal partial class PageResult
 15    {
 16        /// <summary> Initializes a new instance of PageResult. </summary>
 17        /// <param name="page"> Page number. </param>
 018        internal PageResult(int page)
 19        {
 020            Page = page;
 021            KeyValuePairs = new ChangeTrackingList<KeyValuePair>();
 022            Tables = new ChangeTrackingList<DataTable>();
 023        }
 24
 25        /// <summary> Initializes a new instance of PageResult. </summary>
 26        /// <param name="page"> Page number. </param>
 27        /// <param name="clusterId"> Cluster identifier. </param>
 28        /// <param name="keyValuePairs"> List of key-value pairs extracted from the page. </param>
 29        /// <param name="tables"> List of data tables extracted from the page. </param>
 16430        internal PageResult(int page, int? clusterId, IReadOnlyList<KeyValuePair> keyValuePairs, IReadOnlyList<DataTable
 31        {
 16432            Page = page;
 16433            ClusterId = clusterId;
 16434            KeyValuePairs = keyValuePairs;
 16435            Tables = tables;
 16436        }
 37
 38        /// <summary> Page number. </summary>
 13239        public int Page { get; }
 40        /// <summary> Cluster identifier. </summary>
 4441        public int? ClusterId { get; }
 42        /// <summary> List of key-value pairs extracted from the page. </summary>
 4443        public IReadOnlyList<KeyValuePair> KeyValuePairs { get; }
 44        /// <summary> List of data tables extracted from the page. </summary>
 32845        public IReadOnlyList<DataTable> Tables { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\PageResult.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 PageResult
 15    {
 16        internal static PageResult DeserializePageResult(JsonElement element)
 17        {
 16418            int page = default;
 16419            Optional<int?> clusterId = default;
 16420            Optional<IReadOnlyList<KeyValuePair>> keyValuePairs = default;
 16421            Optional<IReadOnlyList<DataTable>> tables = default;
 116022            foreach (var property in element.EnumerateObject())
 23            {
 41624                if (property.NameEquals("page"))
 25                {
 16426                    page = property.Value.GetInt32();
 16427                    continue;
 28                }
 25229                if (property.NameEquals("clusterId"))
 30                {
 4431                    if (property.Value.ValueKind == JsonValueKind.Null)
 32                    {
 2033                        clusterId = null;
 2034                        continue;
 35                    }
 2436                    clusterId = property.Value.GetInt32();
 2437                    continue;
 38                }
 20839                if (property.NameEquals("keyValuePairs"))
 40                {
 4441                    List<KeyValuePair> array = new List<KeyValuePair>();
 124042                    foreach (var item in property.Value.EnumerateArray())
 43                    {
 57644                        array.Add(KeyValuePair.DeserializeKeyValuePair(item));
 45                    }
 4446                    keyValuePairs = array;
 4447                    continue;
 48                }
 16449                if (property.NameEquals("tables"))
 50                {
 16451                    List<DataTable> array = new List<DataTable>();
 58452                    foreach (var item in property.Value.EnumerateArray())
 53                    {
 12854                        array.Add(DataTable.DeserializeDataTable(item));
 55                    }
 16456                    tables = array;
 57                    continue;
 58                }
 59            }
 16460            return new PageResult(page, Optional.ToNullable(clusterId), Optional.ToList(keyValuePairs), Optional.ToList(
 61        }
 62    }
 63}