< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.Models.Tag
Assembly:Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.CustomVision.Training\src\Generated\Models\Tag.cs
Covered lines:7
Uncovered lines:14
Coverable lines:21
Total lines:109
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_Id()-100%100%
get_Name()-100%100%
get_Description()-100%100%
get_Type()-100%100%
get_ImageCount()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.CustomVision.Training\src\Generated\Models\Tag.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.CustomVision.Training.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Represents a Tag.
 19    /// </summary>
 20    public partial class Tag
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the Tag class.
 24        /// </summary>
 5425        public Tag()
 26        {
 27            CustomInit();
 5428        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the Tag class.
 32        /// </summary>
 33        /// <param name="name">Gets or sets the name of the tag.</param>
 34        /// <param name="description">Gets or sets the description of the
 35        /// tag.</param>
 36        /// <param name="type">Gets or sets the type of the tag. Possible
 37        /// values include: 'Regular', 'Negative', 'GeneralProduct'</param>
 38        /// <param name="id">Gets the Tag ID.</param>
 39        /// <param name="imageCount">Gets the number of images with this
 40        /// tag.</param>
 041        public Tag(string name, string description, string type, System.Guid id = default(System.Guid), int imageCount =
 42        {
 043            Id = id;
 044            Name = name;
 045            Description = description;
 046            Type = type;
 047            ImageCount = imageCount;
 48            CustomInit();
 049        }
 50
 51        /// <summary>
 52        /// An initialization method that performs custom operations like setting defaults
 53        /// </summary>
 54        partial void CustomInit();
 55
 56        /// <summary>
 57        /// Gets the Tag ID.
 58        /// </summary>
 59        [JsonProperty(PropertyName = "id")]
 11860        public System.Guid Id { get; private set; }
 61
 62        /// <summary>
 63        /// Gets or sets the name of the tag.
 64        /// </summary>
 65        [JsonProperty(PropertyName = "name")]
 8266        public string Name { get; set; }
 67
 68        /// <summary>
 69        /// Gets or sets the description of the tag.
 70        /// </summary>
 71        [JsonProperty(PropertyName = "description")]
 2072        public string Description { get; set; }
 73
 74        /// <summary>
 75        /// Gets or sets the type of the tag. Possible values include:
 76        /// 'Regular', 'Negative', 'GeneralProduct'
 77        /// </summary>
 78        [JsonProperty(PropertyName = "type")]
 5479        public string Type { get; set; }
 80
 81        /// <summary>
 82        /// Gets the number of images with this tag.
 83        /// </summary>
 84        [JsonProperty(PropertyName = "imageCount")]
 6685        public int ImageCount { get; private set; }
 86
 87        /// <summary>
 88        /// Validate the object.
 89        /// </summary>
 90        /// <exception cref="ValidationException">
 91        /// Thrown if validation fails
 92        /// </exception>
 93        public virtual void Validate()
 94        {
 095            if (Name == null)
 96            {
 097                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 98            }
 099            if (Description == null)
 100            {
 0101                throw new ValidationException(ValidationRules.CannotBeNull, "Description");
 102            }
 0103            if (Type == null)
 104            {
 0105                throw new ValidationException(ValidationRules.CannotBeNull, "Type");
 106            }
 0107        }
 108    }
 109}