< Summary

Class:Azure.Search.Documents.GetDocumentOptions
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Options\GetDocumentOptions.cs
Covered lines:2
Uncovered lines:0
Coverable lines:2
Total lines:29
Line coverage:100% (2 of 2)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_SelectedFields()-100%100%
get_SelectedFieldsOrNull()-100%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Options\GetDocumentOptions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7namespace Azure.Search.Documents
 8{
 9    /// <summary>
 10    /// Options for <see cref="SearchClient.GetDocumentAsync"/>.
 11    /// </summary>
 12    public class GetDocumentOptions
 13    {
 14        /// <summary>
 15        /// A list of field names to retrieve.  Only fields marked as
 16        /// retrievable can be included in this clause.  Any field not
 17        /// retrieved will be missing from the returned document.  If empty,
 18        /// all fields marked as retrievable in the schema are returned.
 19        /// </summary>
 4820        public IList<string> SelectedFields { get; internal set; } = new List<string>();
 21
 22        /// <summary>
 23        /// Gets the selected fields.  If the collection is null or empty, we
 24        /// return null.
 25        /// </summary>
 26        internal IEnumerable<string> SelectedFieldsOrNull =>
 1227            SelectedFields?.Count > 0 ? SelectedFields : null;
 28    }
 29}