< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.Face.Models.LargeFaceList
Assembly:Microsoft.Azure.CognitiveServices.Vision.Face
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\LargeFaceList.cs
Covered lines:2
Uncovered lines:13
Coverable lines:15
Total lines:85
Line coverage:13.3% (2 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_LargeFaceListId()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\LargeFaceList.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    /// Large face list object.
 19    /// </summary>
 20    public partial class LargeFaceList : MetaDataContract
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the LargeFaceList class.
 24        /// </summary>
 225        public LargeFaceList()
 26        {
 27            CustomInit();
 228        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the LargeFaceList class.
 32        /// </summary>
 33        /// <param name="largeFaceListId">LargeFaceListId of the target large
 34        /// face list.</param>
 35        /// <param name="name">User defined name, maximum length is
 36        /// 128.</param>
 37        /// <param name="userData">User specified data. Length should not
 38        /// exceed 16KB.</param>
 39        /// <param name="recognitionModel">Possible values include:
 40        /// 'recognition_01', 'recognition_02'</param>
 41        public LargeFaceList(string largeFaceListId, string name = default(string), string userData = default(string), s
 042            : base(name, userData, recognitionModel)
 43        {
 044            LargeFaceListId = largeFaceListId;
 45            CustomInit();
 046        }
 47
 48        /// <summary>
 49        /// An initialization method that performs custom operations like setting defaults
 50        /// </summary>
 51        partial void CustomInit();
 52
 53        /// <summary>
 54        /// Gets or sets largeFaceListId of the target large face list.
 55        /// </summary>
 56        [JsonProperty(PropertyName = "largeFaceListId")]
 057        public string LargeFaceListId { get; set; }
 58
 59        /// <summary>
 60        /// Validate the object.
 61        /// </summary>
 62        /// <exception cref="ValidationException">
 63        /// Thrown if validation fails
 64        /// </exception>
 65        public override void Validate()
 66        {
 067            base.Validate();
 068            if (LargeFaceListId == null)
 69            {
 070                throw new ValidationException(ValidationRules.CannotBeNull, "LargeFaceListId");
 71            }
 072            if (LargeFaceListId != null)
 73            {
 074                if (LargeFaceListId.Length > 64)
 75                {
 076                    throw new ValidationException(ValidationRules.MaxLength, "LargeFaceListId", 64);
 77                }
 078                if (!System.Text.RegularExpressions.Regex.IsMatch(LargeFaceListId, "^[a-z0-9-_]+$"))
 79                {
 080                    throw new ValidationException(ValidationRules.Pattern, "LargeFaceListId", "^[a-z0-9-_]+$");
 81                }
 82            }
 083        }
 84    }
 85}