< Summary

Class:Microsoft.Azure.CognitiveServices.Search.ImageSearch.Models.RecognizedEntityGroup
Assembly:Microsoft.Azure.CognitiveServices.Search.BingImageSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingImageSearch\src\Generated\ImageSearch\Models\RecognizedEntityGroup.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:96
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_RecognizedEntityRegions()-0%100%
get_Name()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingImageSearch\src\Generated\ImageSearch\Models\RecognizedEntityGroup.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.ImageSearch.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Collections;
 12    using System.Collections.Generic;
 13    using System.Linq;
 14
 15    /// <summary>
 16    /// Defines a group of previously recognized entities.
 17    /// </summary>
 18    public partial class RecognizedEntityGroup
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the RecognizedEntityGroup class.
 22        /// </summary>
 023        public RecognizedEntityGroup()
 24        {
 25            CustomInit();
 026        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the RecognizedEntityGroup class.
 30        /// </summary>
 31        /// <param name="recognizedEntityRegions">The regions of the image that
 32        /// contain entities.</param>
 33        /// <param name="name">The name of the group where images of the entity
 34        /// were also found. The following are possible groups.
 35        /// CelebRecognitionAnnotations: Similar to CelebrityAnnotations but
 36        /// provides a higher probability of an accurate match.
 37        /// CelebrityAnnotations: Contains celebrities such as actors,
 38        /// politicians, athletes, and historical figures.</param>
 039        public RecognizedEntityGroup(IList<RecognizedEntityRegion> recognizedEntityRegions, string name)
 40        {
 041            RecognizedEntityRegions = recognizedEntityRegions;
 042            Name = name;
 43            CustomInit();
 044        }
 45
 46        /// <summary>
 47        /// An initialization method that performs custom operations like setting defaults
 48        /// </summary>
 49        partial void CustomInit();
 50
 51        /// <summary>
 52        /// Gets or sets the regions of the image that contain entities.
 53        /// </summary>
 54        [JsonProperty(PropertyName = "recognizedEntityRegions")]
 055        public IList<RecognizedEntityRegion> RecognizedEntityRegions { get; set; }
 56
 57        /// <summary>
 58        /// Gets or sets the name of the group where images of the entity were
 59        /// also found. The following are possible groups.
 60        /// CelebRecognitionAnnotations: Similar to CelebrityAnnotations but
 61        /// provides a higher probability of an accurate match.
 62        /// CelebrityAnnotations: Contains celebrities such as actors,
 63        /// politicians, athletes, and historical figures.
 64        /// </summary>
 65        [JsonProperty(PropertyName = "name")]
 066        public string Name { get; set; }
 67
 68        /// <summary>
 69        /// Validate the object.
 70        /// </summary>
 71        /// <exception cref="ValidationException">
 72        /// Thrown if validation fails
 73        /// </exception>
 74        public virtual void Validate()
 75        {
 076            if (RecognizedEntityRegions == null)
 77            {
 078                throw new ValidationException(ValidationRules.CannotBeNull, "RecognizedEntityRegions");
 79            }
 080            if (Name == null)
 81            {
 082                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 83            }
 084            if (RecognizedEntityRegions != null)
 85            {
 086                foreach (var element in RecognizedEntityRegions)
 87                {
 088                    if (element != null)
 89                    {
 090                        element.Validate();
 91                    }
 92                }
 93            }
 094        }
 95    }
 96}