< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeStopAnalyzer(...)-0%0%
get_Stopwords()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\StopAnalyzer.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 Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Divides text at non-letters; Applies the lowercase and stopword token filters. This analyzer is implem
 15    public partial class StopAnalyzer : LexicalAnalyzer
 16    {
 17        /// <summary> Initializes a new instance of StopAnalyzer. </summary>
 18        /// <param name="name"> The name of the analyzer. It must only contain letters, digits, spaces, dashes or unders
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 020        public StopAnalyzer(string name) : base(name)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 26
 027            Stopwords = new ChangeTrackingList<string>();
 028            ODataType = "#Microsoft.Azure.Search.StopAnalyzer";
 029        }
 30
 31        /// <summary> Initializes a new instance of StopAnalyzer. </summary>
 32        /// <param name="oDataType"> Identifies the concrete type of the analyzer. </param>
 33        /// <param name="name"> The name of the analyzer. It must only contain letters, digits, spaces, dashes or unders
 34        /// <param name="stopwords"> A list of stopwords. </param>
 035        internal StopAnalyzer(string oDataType, string name, IList<string> stopwords) : base(oDataType, name)
 36        {
 037            Stopwords = stopwords;
 038            ODataType = oDataType ?? "#Microsoft.Azure.Search.StopAnalyzer";
 039        }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\StopAnalyzer.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    public partial class StopAnalyzer : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsCollectionDefined(Stopwords))
 20            {
 021                writer.WritePropertyName("stopwords");
 022                writer.WriteStartArray();
 023                foreach (var item in Stopwords)
 24                {
 025                    writer.WriteStringValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            writer.WritePropertyName("@odata.type");
 030            writer.WriteStringValue(ODataType);
 031            writer.WritePropertyName("name");
 032            writer.WriteStringValue(Name);
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static StopAnalyzer DeserializeStopAnalyzer(JsonElement element)
 37        {
 038            Optional<IList<string>> stopwords = default;
 039            string odataType = default;
 040            string name = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("stopwords"))
 44                {
 045                    List<string> array = new List<string>();
 046                    foreach (var item in property.Value.EnumerateArray())
 47                    {
 048                        array.Add(item.GetString());
 49                    }
 050                    stopwords = array;
 051                    continue;
 52                }
 053                if (property.NameEquals("@odata.type"))
 54                {
 055                    odataType = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("name"))
 59                {
 060                    name = property.Value.GetString();
 61                    continue;
 62                }
 63            }
 064            return new StopAnalyzer(odataType, name, Optional.ToList(stopwords));
 65        }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\StopAnalyzer.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using Azure.Core;
 6
 7namespace Azure.Search.Documents.Indexes.Models
 8{
 9    public partial class StopAnalyzer
 10    {
 11        /// <summary> A list of stopwords. </summary>
 012        public IList<string> Stopwords { get; }
 13    }
 14}