< Summary

Class:Microsoft.Azure.Search.Models.TokenFilter
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\TokenFilter.cs
Covered lines:8
Uncovered lines:1
Coverable lines:9
Total lines:73
Line coverage:88.8% (8 of 9)
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_Name()-100%100%
Validate()-66.67%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\TokenFilter.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    /// Abstract base class for token filters.
 19    /// <see
 20    /// href="https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search"
 21    /// />
 22    /// </summary>
 23    public partial class TokenFilter
 24    {
 25        /// <summary>
 26        /// Initializes a new instance of the TokenFilter class.
 27        /// </summary>
 33028        public TokenFilter()
 29        {
 30            CustomInit();
 33031        }
 32
 33        /// <summary>
 34        /// Initializes a new instance of the TokenFilter class.
 35        /// </summary>
 36        /// <param name="name">The name of the token filter. It must only
 37        /// contain letters, digits, spaces, dashes or underscores, can only
 38        /// start and end with alphanumeric characters, and is limited to 128
 39        /// characters.</param>
 35440        public TokenFilter(string name)
 41        {
 35442            Name = name;
 43            CustomInit();
 35444        }
 45
 46        /// <summary>
 47        /// An initialization method that performs custom operations like setting defaults
 48        /// </summary>
 49        partial void CustomInit();
 50
 51        /// <summary>
 52        /// Gets or sets the name of the token filter. It must only contain
 53        /// letters, digits, spaces, dashes or underscores, can only start and
 54        /// end with alphanumeric characters, and is limited to 128 characters.
 55        /// </summary>
 56        [JsonProperty(PropertyName = "name")]
 200457        public string Name { get; set; }
 58
 59        /// <summary>
 60        /// Validate the object.
 61        /// </summary>
 62        /// <exception cref="ValidationException">
 63        /// Thrown if validation fails
 64        /// </exception>
 65        public virtual void Validate()
 66        {
 33067            if (Name == null)
 68            {
 069                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 70            }
 33071        }
 72    }
 73}