< Summary

Class:Microsoft.Azure.Search.Models.Skillset
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\Skillset.cs
Covered lines:22
Uncovered lines:3
Coverable lines:25
Total lines:122
Line coverage:88% (22 of 25)
Covered branches:9
Total branches:12
Branch coverage:75% (9 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Description()-100%100%
get_Skills()-100%100%
get_CognitiveServices()-100%100%
get_ETag()-100%100%
Validate()-72.73%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\Skillset.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.Search.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    /// A list of skills.
 21    /// <see
 22    /// href="https://docs.microsoft.com/azure/search/cognitive-search-tutorial-blob"
 23    /// />
 24    /// </summary>
 25    public partial class Skillset
 26    {
 27        /// <summary>
 28        /// Initializes a new instance of the Skillset class.
 29        /// </summary>
 8630        public Skillset()
 31        {
 32            CustomInit();
 8633        }
 34
 35        /// <summary>
 36        /// Initializes a new instance of the Skillset class.
 37        /// </summary>
 38        /// <param name="name">The name of the skillset.</param>
 39        /// <param name="description">The description of the skillset.</param>
 40        /// <param name="skills">A list of skills in the skillset.</param>
 41        /// <param name="cognitiveServices">Details about cognitive services to
 42        /// be used when running skills.</param>
 43        /// <param name="eTag">The ETag of the skillset.</param>
 8044        public Skillset(string name, string description, IList<Skill> skills, CognitiveServices cognitiveServices = defa
 45        {
 8046            Name = name;
 8047            Description = description;
 8048            Skills = skills;
 8049            CognitiveServices = cognitiveServices;
 8050            ETag = eTag;
 51            CustomInit();
 8052        }
 53
 54        /// <summary>
 55        /// An initialization method that performs custom operations like setting defaults
 56        /// </summary>
 57        partial void CustomInit();
 58
 59        /// <summary>
 60        /// Gets or sets the name of the skillset.
 61        /// </summary>
 62        [JsonProperty(PropertyName = "name")]
 55663        public string Name { get; set; }
 64
 65        /// <summary>
 66        /// Gets or sets the description of the skillset.
 67        /// </summary>
 68        [JsonProperty(PropertyName = "description")]
 46269        public string Description { get; set; }
 70
 71        /// <summary>
 72        /// Gets or sets a list of skills in the skillset.
 73        /// </summary>
 74        [JsonProperty(PropertyName = "skills")]
 70875        public IList<Skill> Skills { get; set; }
 76
 77        /// <summary>
 78        /// Gets or sets details about cognitive services to be used when
 79        /// running skills.
 80        /// </summary>
 81        [JsonProperty(PropertyName = "cognitiveServices")]
 30082        public CognitiveServices CognitiveServices { get; set; }
 83
 84        /// <summary>
 85        /// Gets or sets the ETag of the skillset.
 86        /// </summary>
 87        [JsonProperty(PropertyName = "@odata.etag")]
 24688        public string ETag { get; set; }
 89
 90        /// <summary>
 91        /// Validate the object.
 92        /// </summary>
 93        /// <exception cref="ValidationException">
 94        /// Thrown if validation fails
 95        /// </exception>
 96        public virtual void Validate()
 97        {
 8098            if (Name == null)
 99            {
 0100                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 101            }
 80102            if (Description == null)
 103            {
 0104                throw new ValidationException(ValidationRules.CannotBeNull, "Description");
 105            }
 80106            if (Skills == null)
 107            {
 0108                throw new ValidationException(ValidationRules.CannotBeNull, "Skills");
 109            }
 80110            if (Skills != null)
 111            {
 384112                foreach (var element in Skills)
 113                {
 112114                    if (element != null)
 115                    {
 112116                        element.Validate();
 117                    }
 118                }
 119            }
 80120        }
 121    }
 122}