< Summary

Class:Azure.AI.FormRecognizer.Models.DataTable
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\DataTable.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\DataTable.Serialization.cs
Covered lines:24
Uncovered lines:7
Coverable lines:31
Total lines:99
Line coverage:77.4% (24 of 31)
Covered branches:10
Total branches:12
Branch coverage:83.3% (10 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Rows()-100%100%
get_Columns()-100%100%
get_Cells()-100%100%
DeserializeDataTable(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\DataTable.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 System.Linq;
 11
 12namespace Azure.AI.FormRecognizer.Models
 13{
 14    /// <summary> Information about the extracted table contained in a page. </summary>
 15    internal partial class DataTable
 16    {
 17        /// <summary> Initializes a new instance of DataTable. </summary>
 18        /// <param name="rows"> Number of rows. </param>
 19        /// <param name="columns"> Number of columns. </param>
 20        /// <param name="cells"> List of cells contained in the table. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="cells"/> is null. </exception>
 022        internal DataTable(int rows, int columns, IEnumerable<DataTableCell> cells)
 23        {
 024            if (cells == null)
 25            {
 026                throw new ArgumentNullException(nameof(cells));
 27            }
 28
 029            Rows = rows;
 030            Columns = columns;
 031            Cells = cells.ToList();
 032        }
 33
 34        /// <summary> Initializes a new instance of DataTable. </summary>
 35        /// <param name="rows"> Number of rows. </param>
 36        /// <param name="columns"> Number of columns. </param>
 37        /// <param name="cells"> List of cells contained in the table. </param>
 12838        internal DataTable(int rows, int columns, IReadOnlyList<DataTableCell> cells)
 39        {
 12840            Rows = rows;
 12841            Columns = columns;
 12842            Cells = cells;
 12843        }
 44
 45        /// <summary> Number of rows. </summary>
 12846        public int Rows { get; }
 47        /// <summary> Number of columns. </summary>
 12848        public int Columns { get; }
 49        /// <summary> List of cells contained in the table. </summary>
 12850        public IReadOnlyList<DataTableCell> Cells { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\DataTable.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 DataTable
 15    {
 16        internal static DataTable DeserializeDataTable(JsonElement element)
 17        {
 12818            int rows = default;
 12819            int columns = default;
 12820            IReadOnlyList<DataTableCell> cells = default;
 102421            foreach (var property in element.EnumerateObject())
 22            {
 38423                if (property.NameEquals("rows"))
 24                {
 12825                    rows = property.Value.GetInt32();
 12826                    continue;
 27                }
 25628                if (property.NameEquals("columns"))
 29                {
 12830                    columns = property.Value.GetInt32();
 12831                    continue;
 32                }
 12833                if (property.NameEquals("cells"))
 34                {
 12835                    List<DataTableCell> array = new List<DataTableCell>();
 513636                    foreach (var item in property.Value.EnumerateArray())
 37                    {
 244038                        array.Add(DataTableCell.DeserializeDataTableCell(item));
 39                    }
 12840                    cells = array;
 41                    continue;
 42                }
 43            }
 12844            return new DataTable(rows, columns, cells);
 45        }
 46    }
 47}