< Summary

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

File(s)

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

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