< Summary

Class:Microsoft.Azure.Search.Models.StandardAnalyzer
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\StandardAnalyzer.cs
Covered lines:11
Uncovered lines:1
Coverable lines:12
Total lines:90
Line coverage:91.6% (11 of 12)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_MaxTokenLength()-100%100%
get_Stopwords()-100%100%
Validate()-75%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\StandardAnalyzer.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Search.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Standard Apache Lucene analyzer; Composed of the standard tokenizer,
 21    /// lowercase filter and stop filter.
 22    /// <see
 23    /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardAnalyzer
 24    /// />
 25    /// </summary>
 26    [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.StandardAnalyzer")]
 27    public partial class StandardAnalyzer : Analyzer
 28    {
 29        /// <summary>
 30        /// Initializes a new instance of the StandardAnalyzer class.
 31        /// </summary>
 432        public StandardAnalyzer()
 33        {
 34            CustomInit();
 435        }
 36
 37        /// <summary>
 38        /// Initializes a new instance of the StandardAnalyzer class.
 39        /// </summary>
 40        /// <param name="name">The name of the analyzer. It must only contain
 41        /// letters, digits, spaces, dashes or underscores, can only start and
 42        /// end with alphanumeric characters, and is limited to 128
 43        /// characters.</param>
 44        /// <param name="maxTokenLength">The maximum token length. Default is
 45        /// 255. Tokens longer than the maximum length are split. The maximum
 46        /// token length that can be used is 300 characters.</param>
 47        /// <param name="stopwords">A list of stopwords.</param>
 48        public StandardAnalyzer(string name, int? maxTokenLength = default(int?), IList<string> stopwords = default(ILis
 649            : base(name)
 50        {
 651            MaxTokenLength = maxTokenLength;
 652            Stopwords = stopwords;
 53            CustomInit();
 654        }
 55
 56        /// <summary>
 57        /// An initialization method that performs custom operations like setting defaults
 58        /// </summary>
 59        partial void CustomInit();
 60
 61        /// <summary>
 62        /// Gets or sets the maximum token length. Default is 255. Tokens
 63        /// longer than the maximum length are split. The maximum token length
 64        /// that can be used is 300 characters.
 65        /// </summary>
 66        [JsonProperty(PropertyName = "maxTokenLength")]
 2667        public int? MaxTokenLength { get; set; }
 68
 69        /// <summary>
 70        /// Gets or sets a list of stopwords.
 71        /// </summary>
 72        [JsonProperty(PropertyName = "stopwords")]
 2273        public IList<string> Stopwords { get; set; }
 74
 75        /// <summary>
 76        /// Validate the object.
 77        /// </summary>
 78        /// <exception cref="ValidationException">
 79        /// Thrown if validation fails
 80        /// </exception>
 81        public override void Validate()
 82        {
 483            base.Validate();
 484            if (MaxTokenLength > 300)
 85            {
 086                throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxTokenLength", 300);
 87            }
 488        }
 89    }
 90}