< Summary

Class:Azure.Search.Documents.Indexes.Models.ListSkillsetsResult
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListSkillsetsResult.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListSkillsetsResult.Serialization.cs
Covered lines:12
Uncovered lines:5
Coverable lines:17
Total lines:75
Line coverage:70.5% (12 of 17)
Covered branches:6
Total branches:8
Branch coverage:75% (6 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Skillsets()-100%100%
DeserializeListSkillsetsResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListSkillsetsResult.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10using System.Linq;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Response from a list skillset request. If successful, it includes the full definitions of all skillset
 15    internal partial class ListSkillsetsResult
 16    {
 17        /// <summary> Initializes a new instance of ListSkillsetsResult. </summary>
 18        /// <param name="skillsets"> The skillsets defined in the Search service. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="skillsets"/> is null. </exception>
 020        internal ListSkillsetsResult(IEnumerable<SearchIndexerSkillset> skillsets)
 21        {
 022            if (skillsets == null)
 23            {
 024                throw new ArgumentNullException(nameof(skillsets));
 25            }
 26
 027            Skillsets = skillsets.ToList();
 028        }
 29
 30        /// <summary> Initializes a new instance of ListSkillsetsResult. </summary>
 31        /// <param name="skillsets"> The skillsets defined in the Search service. </param>
 232        internal ListSkillsetsResult(IReadOnlyList<SearchIndexerSkillset> skillsets)
 33        {
 234            Skillsets = skillsets;
 235        }
 36
 37        /// <summary> The skillsets defined in the Search service. </summary>
 238        public IReadOnlyList<SearchIndexerSkillset> Skillsets { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListSkillsetsResult.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    internal partial class ListSkillsetsResult
 15    {
 16        internal static ListSkillsetsResult DeserializeListSkillsetsResult(JsonElement element)
 17        {
 218            IReadOnlyList<SearchIndexerSkillset> value = default;
 1219            foreach (var property in element.EnumerateObject())
 20            {
 421                if (property.NameEquals("value"))
 22                {
 223                    List<SearchIndexerSkillset> array = new List<SearchIndexerSkillset>();
 824                    foreach (var item in property.Value.EnumerateArray())
 25                    {
 226                        array.Add(SearchIndexerSkillset.DeserializeSearchIndexerSkillset(item));
 27                    }
 228                    value = array;
 29                    continue;
 30                }
 31            }
 232            return new ListSkillsetsResult(value);
 33        }
 34    }
 35}