< Summary

Class:Microsoft.Azure.Search.Models.CharFilter
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\CharFilter.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\CharFilter.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 character filters.
 19    /// <see
 20    /// href="https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search"
 21    /// />
 22    /// </summary>
 23    public partial class CharFilter
 24    {
 25        /// <summary>
 26        /// Initializes a new instance of the CharFilter class.
 27        /// </summary>
 828        public CharFilter()
 29        {
 30            CustomInit();
 831        }
 32
 33        /// <summary>
 34        /// Initializes a new instance of the CharFilter class.
 35        /// </summary>
 36        /// <param name="name">The name of the char 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>
 840        public CharFilter(string name)
 41        {
 842            Name = name;
 43            CustomInit();
 844        }
 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 char 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")]
 4457        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        {
 867            if (Name == null)
 68            {
 069                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 70            }
 871        }
 72    }
 73}