< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models.Line
Assembly:Microsoft.Azure.CognitiveServices.Vision.ComputerVision
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\Line.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:114
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Language()-0%100%
get_BoundingBox()-0%100%
get_Text()-0%100%
get_Words()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\Line.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// An object representing a recognized text line.
 21    /// </summary>
 22    public partial class Line
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the Line class.
 26        /// </summary>
 027        public Line()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the Line class.
 34        /// </summary>
 35        /// <param name="boundingBox">Bounding box of a recognized
 36        /// line.</param>
 37        /// <param name="text">The text content of the line.</param>
 38        /// <param name="words">List of words in the text line.</param>
 39        /// <param name="language">The BCP-47 language code of the recognized
 40        /// text line. Only provided where the language of the line differs
 41        /// from the page's.</param>
 042        public Line(IList<double?> boundingBox, string text, IList<Word> words, string language = default(string))
 43        {
 044            Language = language;
 045            BoundingBox = boundingBox;
 046            Text = text;
 047            Words = words;
 48            CustomInit();
 049        }
 50
 51        /// <summary>
 52        /// An initialization method that performs custom operations like setting defaults
 53        /// </summary>
 54        partial void CustomInit();
 55
 56        /// <summary>
 57        /// Gets or sets the BCP-47 language code of the recognized text line.
 58        /// Only provided where the language of the line differs from the
 59        /// page's.
 60        /// </summary>
 61        [JsonProperty(PropertyName = "language")]
 062        public string Language { get; set; }
 63
 64        /// <summary>
 65        /// Gets or sets bounding box of a recognized line.
 66        /// </summary>
 67        [JsonProperty(PropertyName = "boundingBox")]
 068        public IList<double?> BoundingBox { get; set; }
 69
 70        /// <summary>
 71        /// Gets or sets the text content of the line.
 72        /// </summary>
 73        [JsonProperty(PropertyName = "text")]
 074        public string Text { get; set; }
 75
 76        /// <summary>
 77        /// Gets or sets list of words in the text line.
 78        /// </summary>
 79        [JsonProperty(PropertyName = "words")]
 080        public IList<Word> Words { get; set; }
 81
 82        /// <summary>
 83        /// Validate the object.
 84        /// </summary>
 85        /// <exception cref="ValidationException">
 86        /// Thrown if validation fails
 87        /// </exception>
 88        public virtual void Validate()
 89        {
 090            if (BoundingBox == null)
 91            {
 092                throw new ValidationException(ValidationRules.CannotBeNull, "BoundingBox");
 93            }
 094            if (Text == null)
 95            {
 096                throw new ValidationException(ValidationRules.CannotBeNull, "Text");
 97            }
 098            if (Words == null)
 99            {
 0100                throw new ValidationException(ValidationRules.CannotBeNull, "Words");
 101            }
 0102            if (Words != null)
 103            {
 0104                foreach (var element in Words)
 105                {
 0106                    if (element != null)
 107                    {
 0108                        element.Validate();
 109                    }
 110                }
 111            }
 0112        }
 113    }
 114}