< Summary

Class:Microsoft.Azure.Search.Models.UaxUrlEmailTokenizer
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\UaxUrlEmailTokenizer.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:80
Line coverage:90% (9 of 10)
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%
Validate()-75%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\UaxUrlEmailTokenizer.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.Linq;
 16
 17    /// <summary>
 18    /// Tokenizes urls and emails as one token. This tokenizer is implemented
 19    /// using Apache Lucene.
 20    /// <see
 21    /// href="http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/UAX29URLEmailTok
 22    /// />
 23    /// </summary>
 24    [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.UaxUrlEmailTokenizer")]
 25    public partial class UaxUrlEmailTokenizer : Tokenizer
 26    {
 27        /// <summary>
 28        /// Initializes a new instance of the UaxUrlEmailTokenizer class.
 29        /// </summary>
 430        public UaxUrlEmailTokenizer()
 31        {
 32            CustomInit();
 433        }
 34
 35        /// <summary>
 36        /// Initializes a new instance of the UaxUrlEmailTokenizer class.
 37        /// </summary>
 38        /// <param name="name">The name of the tokenizer. It must only contain
 39        /// letters, digits, spaces, dashes or underscores, can only start and
 40        /// end with alphanumeric characters, and is limited to 128
 41        /// characters.</param>
 42        /// <param name="maxTokenLength">The maximum token length. Default is
 43        /// 255. Tokens longer than the maximum length are split. The maximum
 44        /// token length that can be used is 300 characters.</param>
 45        public UaxUrlEmailTokenizer(string name, int? maxTokenLength = default(int?))
 646            : base(name)
 47        {
 648            MaxTokenLength = maxTokenLength;
 49            CustomInit();
 650        }
 51
 52        /// <summary>
 53        /// An initialization method that performs custom operations like setting defaults
 54        /// </summary>
 55        partial void CustomInit();
 56
 57        /// <summary>
 58        /// Gets or sets the maximum token length. Default is 255. Tokens
 59        /// longer than the maximum length are split. The maximum token length
 60        /// that can be used is 300 characters.
 61        /// </summary>
 62        [JsonProperty(PropertyName = "maxTokenLength")]
 2663        public int? MaxTokenLength { get; set; }
 64
 65        /// <summary>
 66        /// Validate the object.
 67        /// </summary>
 68        /// <exception cref="ValidationException">
 69        /// Thrown if validation fails
 70        /// </exception>
 71        public override void Validate()
 72        {
 473            base.Validate();
 474            if (MaxTokenLength > 300)
 75            {
 076                throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxTokenLength", 300);
 77            }
 478        }
 79    }
 80}