< Summary

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

File(s)

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

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