< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.Face.Models.DetectedFace
Assembly:Microsoft.Azure.CognitiveServices.Vision.Face
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\DetectedFace.cs
Covered lines:7
Uncovered lines:14
Coverable lines:21
Total lines:99
Line coverage:33.3% (7 of 21)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_FaceId()-100%100%
get_RecognitionModel()-100%100%
get_FaceRectangle()-100%100%
get_FaceLandmarks()-100%100%
get_FaceAttributes()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\DetectedFace.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.Linq;
 16
 17    /// <summary>
 18    /// Detected Face object.
 19    /// </summary>
 20    public partial class DetectedFace
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the DetectedFace class.
 24        /// </summary>
 9825        public DetectedFace()
 26        {
 27            CustomInit();
 9828        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the DetectedFace class.
 32        /// </summary>
 33        /// <param name="recognitionModel">Possible values include:
 34        /// 'recognition_01', 'recognition_02'</param>
 035        public DetectedFace(FaceRectangle faceRectangle, System.Guid? faceId = default(System.Guid?), string recognition
 36        {
 037            FaceId = faceId;
 038            RecognitionModel = recognitionModel;
 039            FaceRectangle = faceRectangle;
 040            FaceLandmarks = faceLandmarks;
 041            FaceAttributes = faceAttributes;
 42            CustomInit();
 043        }
 44
 45        /// <summary>
 46        /// An initialization method that performs custom operations like setting defaults
 47        /// </summary>
 48        partial void CustomInit();
 49
 50        /// <summary>
 51        /// </summary>
 52        [JsonProperty(PropertyName = "faceId")]
 13853        public System.Guid? FaceId { get; set; }
 54
 55        /// <summary>
 56        /// Gets or sets possible values include: 'recognition_01',
 57        /// 'recognition_02'
 58        /// </summary>
 59        [JsonProperty(PropertyName = "recognitionModel")]
 460        public string RecognitionModel { get; set; }
 61
 62        /// <summary>
 63        /// </summary>
 64        [JsonProperty(PropertyName = "faceRectangle")]
 39665        public FaceRectangle FaceRectangle { get; set; }
 66
 67        /// <summary>
 68        /// </summary>
 69        [JsonProperty(PropertyName = "faceLandmarks")]
 670        public FaceLandmarks FaceLandmarks { get; set; }
 71
 72        /// <summary>
 73        /// </summary>
 74        [JsonProperty(PropertyName = "faceAttributes")]
 4675        public FaceAttributes FaceAttributes { get; set; }
 76
 77        /// <summary>
 78        /// Validate the object.
 79        /// </summary>
 80        /// <exception cref="ValidationException">
 81        /// Thrown if validation fails
 82        /// </exception>
 83        public virtual void Validate()
 84        {
 085            if (FaceRectangle == null)
 86            {
 087                throw new ValidationException(ValidationRules.CannotBeNull, "FaceRectangle");
 88            }
 089            if (FaceRectangle != null)
 90            {
 091                FaceRectangle.Validate();
 92            }
 093            if (FaceLandmarks != null)
 94            {
 095                FaceLandmarks.Validate();
 96            }
 097        }
 98    }
 99}