< Summary

Class:Azure.Search.Documents.Models.SuggestDocumentsResult
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SuggestDocumentsResult.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SuggestDocumentsResult.Serialization.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:85
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Results()-0%100%
get_Coverage()-0%100%
DeserializeSuggestDocumentsResult(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SuggestDocumentsResult.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.Models
 13{
 14    /// <summary> Response containing suggestion query results from an index. </summary>
 15    internal partial class SuggestDocumentsResult
 16    {
 17        /// <summary> Initializes a new instance of SuggestDocumentsResult. </summary>
 18        /// <param name="results"> The sequence of results returned by the query. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="results"/> is null. </exception>
 020        internal SuggestDocumentsResult(IEnumerable<SuggestResult> results)
 21        {
 022            if (results == null)
 23            {
 024                throw new ArgumentNullException(nameof(results));
 25            }
 26
 027            Results = results.ToList();
 028        }
 29
 30        /// <summary> Initializes a new instance of SuggestDocumentsResult. </summary>
 31        /// <param name="results"> The sequence of results returned by the query. </param>
 32        /// <param name="coverage"> A value indicating the percentage of the index that was included in the query, or nu
 033        internal SuggestDocumentsResult(IReadOnlyList<SuggestResult> results, double? coverage)
 34        {
 035            Results = results;
 036            Coverage = coverage;
 037        }
 38
 39        /// <summary> The sequence of results returned by the query. </summary>
 040        public IReadOnlyList<SuggestResult> Results { get; }
 41        /// <summary> A value indicating the percentage of the index that was included in the query, or null if minimumC
 042        public double? Coverage { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SuggestDocumentsResult.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.Models
 13{
 14    internal partial class SuggestDocumentsResult
 15    {
 16        internal static SuggestDocumentsResult DeserializeSuggestDocumentsResult(JsonElement element)
 17        {
 018            IReadOnlyList<SuggestResult> value = default;
 019            Optional<double> searchCoverage = default;
 020            foreach (var property in element.EnumerateObject())
 21            {
 022                if (property.NameEquals("value"))
 23                {
 024                    List<SuggestResult> array = new List<SuggestResult>();
 025                    foreach (var item in property.Value.EnumerateArray())
 26                    {
 027                        array.Add(SuggestResult.DeserializeSuggestResult(item));
 28                    }
 029                    value = array;
 030                    continue;
 31                }
 032                if (property.NameEquals("@search.coverage"))
 33                {
 034                    searchCoverage = property.Value.GetDouble();
 35                    continue;
 36                }
 37            }
 038            return new SuggestDocumentsResult(value, Optional.ToNullable(searchCoverage));
 39        }
 40    }
 41}