< Summary

Class:Azure.Search.Documents.Indexes.Models.ListIndexesResult
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListIndexesResult.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListIndexesResult.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_Indexes()-100%100%
DeserializeListIndexesResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListIndexesResult.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 Indexes request. If successful, it includes the full definitions of all indexes. 
 15    internal partial class ListIndexesResult
 16    {
 17        /// <summary> Initializes a new instance of ListIndexesResult. </summary>
 18        /// <param name="indexes"> The indexes in the Search service. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="indexes"/> is null. </exception>
 020        internal ListIndexesResult(IEnumerable<SearchIndex> indexes)
 21        {
 022            if (indexes == null)
 23            {
 024                throw new ArgumentNullException(nameof(indexes));
 25            }
 26
 027            Indexes = indexes.ToList();
 028        }
 29
 30        /// <summary> Initializes a new instance of ListIndexesResult. </summary>
 31        /// <param name="indexes"> The indexes in the Search service. </param>
 232        internal ListIndexesResult(IReadOnlyList<SearchIndex> indexes)
 33        {
 234            Indexes = indexes;
 235        }
 36
 37        /// <summary> The indexes in the Search service. </summary>
 238        public IReadOnlyList<SearchIndex> Indexes { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ListIndexesResult.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 ListIndexesResult
 15    {
 16        internal static ListIndexesResult DeserializeListIndexesResult(JsonElement element)
 17        {
 218            IReadOnlyList<SearchIndex> value = default;
 1219            foreach (var property in element.EnumerateObject())
 20            {
 421                if (property.NameEquals("value"))
 22                {
 223                    List<SearchIndex> array = new List<SearchIndex>();
 1224                    foreach (var item in property.Value.EnumerateArray())
 25                    {
 426                        array.Add(SearchIndex.DeserializeSearchIndex(item));
 27                    }
 228                    value = array;
 29                    continue;
 30                }
 31            }
 232            return new ListIndexesResult(value);
 33        }
 34    }
 35}