< Summary

Class:Azure.AI.FormRecognizer.Models.FormTableCell
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormTableCell.cs
Covered lines:20
Uncovered lines:0
Coverable lines:20
Total lines:70
Line coverage:100% (20 of 20)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_ColumnIndex()-100%100%
get_ColumnSpan()-100%100%
get_Confidence()-100%100%
get_IsFooter()-100%100%
get_IsHeader()-100%100%
get_RowIndex()-100%100%
get_RowSpan()-100%100%
get_FieldElements()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormTableCell.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5
 6namespace Azure.AI.FormRecognizer.Models
 7{
 8    /// <summary>
 9    /// Represents a cell contained in a table recognized from the input document.
 10    /// </summary>
 11    public class FormTableCell : FormElement
 12    {
 13        internal FormTableCell(DataTableCell dataTableCell, IReadOnlyList<ReadResult> readResults, int pageNumber)
 244014            : base(new BoundingBox(dataTableCell.BoundingBox), pageNumber, dataTableCell.Text)
 15        {
 244016            ColumnIndex = dataTableCell.ColumnIndex;
 244017            ColumnSpan = dataTableCell.ColumnSpan ?? 1;
 244018            Confidence = dataTableCell.Confidence;
 244019            IsFooter = dataTableCell.IsFooter ?? false;
 244020            IsHeader = dataTableCell.IsHeader ?? false;
 244021            RowIndex = dataTableCell.RowIndex;
 244022            RowSpan = dataTableCell.RowSpan ?? 1;
 244023            FieldElements = dataTableCell.Elements != null
 244024                ? FormField.ConvertTextReferences(dataTableCell.Elements, readResults)
 244025                : new List<FormElement>();
 244026        }
 27
 28        /// <summary>
 29        /// The column index of the cell.
 30        /// </summary>
 255231        public int ColumnIndex { get; }
 32
 33        /// <summary>
 34        /// The number of columns spanned by this cell.
 35        /// </summary>
 224036        public int ColumnSpan { get; }
 37
 38        /// <summary>
 39        /// Measures the degree of certainty of the recognition result. Value is between [0.0, 1.0].
 40        /// </summary>
 434441        public float Confidence { get; }
 42
 43        /// <summary>
 44        /// <c>true</c> if this cell is a footer cell. Otherwise, <c>false</c>.
 45        /// </summary>
 13646        public bool IsFooter { get; }
 47
 48        /// <summary>
 49        /// <c>true</c> if this cell is a header cell. Otherwise, <c>false</c>.
 50        /// </summary>
 13651        public bool IsHeader { get; }
 52
 53        /// <summary>
 54        /// The row index of this cell.
 55        /// </summary>
 267256        public int RowIndex { get; }
 57
 58        /// <summary>
 59        /// The number of rows spanned by this cell.
 60        /// </summary>
 224061        public int RowSpan { get; }
 62
 63        /// <summary>
 64        /// When `IncludeFieldElements` is set to <c>true</c>, a list of references to
 65        /// the field elements constituting this cell is returned. An empty list otherwise. For calls to recognize conte
 66        /// list is always populated.
 67        /// </summary>
 472068        public IReadOnlyList<FormElement> FieldElements { get; }
 69    }
 70}