< Summary

Class:Azure.Search.Documents.Indexes.Models.SearchIndexerDataContainer
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerDataContainer.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerDataContainer.Serialization.cs
Covered lines:25
Uncovered lines:3
Coverable lines:28
Total lines:90
Line coverage:89.2% (25 of 28)
Covered branches:8
Total branches:10
Branch coverage:80% (8 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-100%100%
get_Name()-100%100%
get_Query()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-75%50%
DeserializeSearchIndexerDataContainer(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerDataContainer.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;
 9
 10namespace Azure.Search.Documents.Indexes.Models
 11{
 12    /// <summary> Represents information about the entity (such as Azure SQL table or CosmosDB collection) that will be 
 13    public partial class SearchIndexerDataContainer
 14    {
 15        /// <summary> Initializes a new instance of SearchIndexerDataContainer. </summary>
 16        /// <param name="name"> The name of the table or view (for Azure SQL data source) or collection (for CosmosDB da
 17        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 518        public SearchIndexerDataContainer(string name)
 19        {
 520            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 525            Name = name;
 526        }
 27
 28        /// <summary> Initializes a new instance of SearchIndexerDataContainer. </summary>
 29        /// <param name="name"> The name of the table or view (for Azure SQL data source) or collection (for CosmosDB da
 30        /// <param name="query"> A query that is applied to this data container. The syntax and meaning of this paramete
 931        internal SearchIndexerDataContainer(string name, string query)
 32        {
 933            Name = name;
 934            Query = query;
 935        }
 36
 37        /// <summary> The name of the table or view (for Azure SQL data source) or collection (for CosmosDB data source)
 3338        public string Name { get; set; }
 39        /// <summary> A query that is applied to this data container. The syntax and meaning of this parameter is dataso
 2840        public string Query { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerDataContainer.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    public partial class SearchIndexerDataContainer : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 717            writer.WriteStartObject();
 718            writer.WritePropertyName("name");
 719            writer.WriteStringValue(Name);
 720            if (Optional.IsDefined(Query))
 21            {
 022                writer.WritePropertyName("query");
 023                writer.WriteStringValue(Query);
 24            }
 725            writer.WriteEndObject();
 726        }
 27
 28        internal static SearchIndexerDataContainer DeserializeSearchIndexerDataContainer(JsonElement element)
 29        {
 930            string name = default;
 931            Optional<string> query = default;
 5432            foreach (var property in element.EnumerateObject())
 33            {
 1834                if (property.NameEquals("name"))
 35                {
 936                    name = property.Value.GetString();
 937                    continue;
 38                }
 939                if (property.NameEquals("query"))
 40                {
 941                    query = property.Value.GetString();
 42                    continue;
 43                }
 44            }
 945            return new SearchIndexerDataContainer(name, query.Value);
 46        }
 47    }
 48}