< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VisualSearch.Models.ImageTagRegion
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVisualSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVisualSearch\src\Generated\Models\ImageTagRegion.cs
Covered lines:4
Uncovered lines:13
Coverable lines:17
Total lines:84
Line coverage:23.5% (4 of 17)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_QueryRectangle()-100%100%
get_DisplayRectangle()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVisualSearch\src\Generated\Models\ImageTagRegion.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.Search.VisualSearch.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Linq;
 12
 13    /// <summary>
 14    /// Defines an image region relevant to the ImageTag.
 15    /// </summary>
 16    public partial class ImageTagRegion
 17    {
 18        /// <summary>
 19        /// Initializes a new instance of the ImageTagRegion class.
 20        /// </summary>
 2821        public ImageTagRegion()
 22        {
 23            CustomInit();
 2824        }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the ImageTagRegion class.
 28        /// </summary>
 29        /// <param name="queryRectangle">A rectangle that outlines the area of
 30        /// interest for this tag.</param>
 31        /// <param name="displayRectangle">A recommended rectangle to show to
 32        /// the user.</param>
 033        public ImageTagRegion(NormalizedQuadrilateral queryRectangle, NormalizedQuadrilateral displayRectangle)
 34        {
 035            QueryRectangle = queryRectangle;
 036            DisplayRectangle = displayRectangle;
 37            CustomInit();
 038        }
 39
 40        /// <summary>
 41        /// An initialization method that performs custom operations like setting defaults
 42        /// </summary>
 43        partial void CustomInit();
 44
 45        /// <summary>
 46        /// Gets or sets a rectangle that outlines the area of interest for
 47        /// this tag.
 48        /// </summary>
 49        [JsonProperty(PropertyName = "queryRectangle")]
 5650        public NormalizedQuadrilateral QueryRectangle { get; set; }
 51
 52        /// <summary>
 53        /// Gets or sets a recommended rectangle to show to the user.
 54        /// </summary>
 55        [JsonProperty(PropertyName = "displayRectangle")]
 5656        public NormalizedQuadrilateral DisplayRectangle { get; set; }
 57
 58        /// <summary>
 59        /// Validate the object.
 60        /// </summary>
 61        /// <exception cref="ValidationException">
 62        /// Thrown if validation fails
 63        /// </exception>
 64        public virtual void Validate()
 65        {
 066            if (QueryRectangle == null)
 67            {
 068                throw new ValidationException(ValidationRules.CannotBeNull, "QueryRectangle");
 69            }
 070            if (DisplayRectangle == null)
 71            {
 072                throw new ValidationException(ValidationRules.CannotBeNull, "DisplayRectangle");
 73            }
 074            if (QueryRectangle != null)
 75            {
 076                QueryRectangle.Validate();
 77            }
 078            if (DisplayRectangle != null)
 79            {
 080                DisplayRectangle.Validate();
 81            }
 082        }
 83    }
 84}