< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.Face.Models.IdentifyResult
Assembly:Microsoft.Azure.CognitiveServices.Vision.Face
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\IdentifyResult.cs
Covered lines:3
Uncovered lines:12
Coverable lines:15
Total lines:91
Line coverage:20% (3 of 15)
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_FaceId()-0%100%
get_Candidates()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\IdentifyResult.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.Face.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    /// Response body for identify face operation.
 21    /// </summary>
 22    public partial class IdentifyResult
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the IdentifyResult class.
 26        /// </summary>
 427        public IdentifyResult()
 28        {
 29            CustomInit();
 430        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the IdentifyResult class.
 34        /// </summary>
 35        /// <param name="faceId">FaceId of the query face</param>
 36        /// <param name="candidates">Identified person candidates for that face
 37        /// (ranked by confidence). Array size should be no larger than input
 38        /// maxNumOfCandidatesReturned. If no person is identified, will return
 39        /// an empty array.</param>
 040        public IdentifyResult(System.Guid faceId, IList<IdentifyCandidate> candidates)
 41        {
 042            FaceId = faceId;
 043            Candidates = candidates;
 44            CustomInit();
 045        }
 46
 47        /// <summary>
 48        /// An initialization method that performs custom operations like setting defaults
 49        /// </summary>
 50        partial void CustomInit();
 51
 52        /// <summary>
 53        /// Gets or sets faceId of the query face
 54        /// </summary>
 55        [JsonProperty(PropertyName = "faceId")]
 056        public System.Guid FaceId { get; set; }
 57
 58        /// <summary>
 59        /// Gets or sets identified person candidates for that face (ranked by
 60        /// confidence). Array size should be no larger than input
 61        /// maxNumOfCandidatesReturned. If no person is identified, will return
 62        /// an empty array.
 63        /// </summary>
 64        [JsonProperty(PropertyName = "candidates")]
 1665        public IList<IdentifyCandidate> Candidates { get; set; }
 66
 67        /// <summary>
 68        /// Validate the object.
 69        /// </summary>
 70        /// <exception cref="ValidationException">
 71        /// Thrown if validation fails
 72        /// </exception>
 73        public virtual void Validate()
 74        {
 075            if (Candidates == null)
 76            {
 077                throw new ValidationException(ValidationRules.CannotBeNull, "Candidates");
 78            }
 079            if (Candidates != null)
 80            {
 081                foreach (var element in Candidates)
 82                {
 083                    if (element != null)
 84                    {
 085                        element.Validate();
 86                    }
 87                }
 88            }
 089        }
 90    }
 91}