< Summary

Class:Azure.Search.Documents.Models.AutocompleteItem
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AutocompleteItem.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AutocompleteItem.Serialization.cs
Covered lines:17
Uncovered lines:2
Coverable lines:19
Total lines:74
Line coverage:89.4% (17 of 19)
Covered branches:8
Total branches:10
Branch coverage:80% (8 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
get_Text()-100%100%
get_QueryPlusText()-100%100%
DeserializeAutocompleteItem(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AutocompleteItem.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.Models
 11{
 12    /// <summary> The result of Autocomplete requests. </summary>
 13    public partial class AutocompleteItem
 14    {
 15        /// <summary> Initializes a new instance of AutocompleteItem. </summary>
 16        /// <param name="text"> The completed term. </param>
 17        /// <param name="queryPlusText"> The query along with the completed term. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="text"/> or <paramref name="queryPlusText"/> is null
 8819        internal AutocompleteItem(string text, string queryPlusText)
 20        {
 8821            if (text == null)
 22            {
 023                throw new ArgumentNullException(nameof(text));
 24            }
 8825            if (queryPlusText == null)
 26            {
 027                throw new ArgumentNullException(nameof(queryPlusText));
 28            }
 29
 8830            Text = text;
 8831            QueryPlusText = queryPlusText;
 8832        }
 33
 34        /// <summary> The completed term. </summary>
 8835        public string Text { get; }
 36        /// <summary> The query along with the completed term. </summary>
 8837        public string QueryPlusText { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\AutocompleteItem.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.Models
 12{
 13    public partial class AutocompleteItem
 14    {
 15        internal static AutocompleteItem DeserializeAutocompleteItem(JsonElement element)
 16        {
 8817            string text = default;
 8818            string queryPlusText = default;
 52819            foreach (var property in element.EnumerateObject())
 20            {
 17621                if (property.NameEquals("text"))
 22                {
 8823                    text = property.Value.GetString();
 8824                    continue;
 25                }
 8826                if (property.NameEquals("queryPlusText"))
 27                {
 8828                    queryPlusText = property.Value.GetString();
 29                    continue;
 30                }
 31            }
 8832            return new AutocompleteItem(text, queryPlusText);
 33        }
 34    }
 35}