< Summary

Class:Azure.AI.FormRecognizer.Models.ReadResult
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ReadResult.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ReadResult.Serialization.cs
Covered lines:47
Uncovered lines:9
Coverable lines:56
Total lines:137
Line coverage:83.9% (47 of 56)
Covered branches:18
Total branches:18
Branch coverage:100% (18 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Page()-100%100%
get_Angle()-100%100%
get_Width()-100%100%
get_Height()-100%100%
get_Unit()-100%100%
get_Language()-0%100%
get_Lines()-100%100%
DeserializeReadResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ReadResult.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> Text extracted from a page in the input document. </summary>
 14    internal partial class ReadResult
 15    {
 16        /// <summary> Initializes a new instance of ReadResult. </summary>
 17        /// <param name="page"> The 1-based page number in the input document. </param>
 18        /// <param name="angle"> The general orientation of the text in clockwise direction, measured in degrees between
 19        /// <param name="width"> The width of the image/PDF in pixels/inches, respectively. </param>
 20        /// <param name="height"> The height of the image/PDF in pixels/inches, respectively. </param>
 21        /// <param name="unit"> The unit used by the width, height and boundingBox properties. For images, the unit is &
 022        internal ReadResult(int page, float angle, float width, float height, LengthUnit unit)
 23        {
 024            Page = page;
 025            Angle = angle;
 026            Width = width;
 027            Height = height;
 028            Unit = unit;
 029            Lines = new ChangeTrackingList<TextLine>();
 030        }
 31
 32        /// <summary> Initializes a new instance of ReadResult. </summary>
 33        /// <param name="page"> The 1-based page number in the input document. </param>
 34        /// <param name="angle"> The general orientation of the text in clockwise direction, measured in degrees between
 35        /// <param name="width"> The width of the image/PDF in pixels/inches, respectively. </param>
 36        /// <param name="height"> The height of the image/PDF in pixels/inches, respectively. </param>
 37        /// <param name="unit"> The unit used by the width, height and boundingBox properties. For images, the unit is &
 38        /// <param name="language"> The detected language on the page overall. </param>
 39        /// <param name="lines"> When includeTextDetails is set to true, a list of recognized text lines. The maximum nu
 21640        internal ReadResult(int page, float angle, float width, float height, LengthUnit unit, Language? language, IRead
 41        {
 21642            Page = page;
 21643            Angle = angle;
 21644            Width = width;
 21645            Height = height;
 21646            Unit = unit;
 21647            Language = language;
 21648            Lines = lines;
 21649        }
 50
 51        /// <summary> The 1-based page number in the input document. </summary>
 84452        public int Page { get; }
 53        /// <summary> The general orientation of the text in clockwise direction, measured in degrees between (-180, 180
 43254        public float Angle { get; }
 55        /// <summary> The width of the image/PDF in pixels/inches, respectively. </summary>
 21656        public float Width { get; }
 57        /// <summary> The height of the image/PDF in pixels/inches, respectively. </summary>
 21658        public float Height { get; }
 59        /// <summary> The unit used by the width, height and boundingBox properties. For images, the unit is &quot;pixel
 21660        public LengthUnit Unit { get; }
 61        /// <summary> The detected language on the page overall. </summary>
 062        public Language? Language { get; }
 63        /// <summary> When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lin
 574064        public IReadOnlyList<TextLine> Lines { get; }
 65    }
 66}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ReadResult.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 ReadResult
 15    {
 16        internal static ReadResult DeserializeReadResult(JsonElement element)
 17        {
 21618            int page = default;
 21619            float angle = default;
 21620            float width = default;
 21621            float height = default;
 21622            LengthUnit unit = default;
 21623            Optional<Language> language = default;
 21624            Optional<IReadOnlyList<TextLine>> lines = default;
 328825            foreach (var property in element.EnumerateObject())
 26            {
 142827                if (property.NameEquals("page"))
 28                {
 21629                    page = property.Value.GetInt32();
 21630                    continue;
 31                }
 121232                if (property.NameEquals("angle"))
 33                {
 21634                    angle = property.Value.GetSingle();
 21635                    continue;
 36                }
 99637                if (property.NameEquals("width"))
 38                {
 21639                    width = property.Value.GetSingle();
 21640                    continue;
 41                }
 78042                if (property.NameEquals("height"))
 43                {
 21644                    height = property.Value.GetSingle();
 21645                    continue;
 46                }
 56447                if (property.NameEquals("unit"))
 48                {
 21649                    unit = property.Value.GetString().ToLengthUnit();
 21650                    continue;
 51                }
 34852                if (property.NameEquals("language"))
 53                {
 17254                    language = new Language(property.Value.GetString());
 17255                    continue;
 56                }
 17657                if (property.NameEquals("lines"))
 58                {
 17659                    List<TextLine> array = new List<TextLine>();
 1022460                    foreach (var item in property.Value.EnumerateArray())
 61                    {
 493662                        array.Add(TextLine.DeserializeTextLine(item));
 63                    }
 17664                    lines = array;
 65                    continue;
 66                }
 67            }
 21668            return new ReadResult(page, angle, width, height, unit, Optional.ToNullable(language), Optional.ToList(lines
 69        }
 70    }
 71}