< Summary

Class:Microsoft.Azure.CognitiveServices.Language.SpellCheck.Models.SpellingFlaggedToken
Assembly:Microsoft.Azure.CognitiveServices.Language.SpellCheck
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.SpellCheck\src\Generated\Models\SpellingFlaggedToken.cs
Covered lines:5
Uncovered lines:18
Coverable lines:23
Total lines:100
Line coverage:21.7% (5 of 23)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Offset()-0%100%
get_Token()-100%100%
get_Type()-100%100%
get_Suggestions()-100%100%
get_PingUrlSuffix()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.SpellCheck\src\Generated\Models\SpellingFlaggedToken.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.Language.SpellCheck.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Collections;
 12    using System.Collections.Generic;
 13    using System.Linq;
 14
 15    public partial class SpellingFlaggedToken
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the SpellingFlaggedToken class.
 19        /// </summary>
 120        public SpellingFlaggedToken()
 21        {
 22            CustomInit();
 123        }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the SpellingFlaggedToken class.
 27        /// </summary>
 28        /// <param name="type">Possible values include: 'UnknownToken',
 29        /// 'RepeatedToken'</param>
 030        public SpellingFlaggedToken(int offset, string token, string type, IList<SpellingTokenSuggestion> suggestions = 
 31        {
 032            Offset = offset;
 033            Token = token;
 034            Type = type;
 035            Suggestions = suggestions;
 036            PingUrlSuffix = pingUrlSuffix;
 37            CustomInit();
 038        }
 39
 40        /// <summary>
 41        /// An initialization method that performs custom operations like setting defaults
 42        /// </summary>
 43        partial void CustomInit();
 44
 45        /// <summary>
 46        /// </summary>
 47        [JsonProperty(PropertyName = "offset")]
 048        public int Offset { get; set; }
 49
 50        /// <summary>
 51        /// </summary>
 52        [JsonProperty(PropertyName = "token")]
 353        public string Token { get; set; }
 54
 55        /// <summary>
 56        /// Gets or sets possible values include: 'UnknownToken',
 57        /// 'RepeatedToken'
 58        /// </summary>
 59        [JsonProperty(PropertyName = "type")]
 260        public string Type { get; set; }
 61
 62        /// <summary>
 63        /// </summary>
 64        [JsonProperty(PropertyName = "suggestions")]
 465        public IList<SpellingTokenSuggestion> Suggestions { get; private set; }
 66
 67        /// <summary>
 68        /// </summary>
 69        [JsonProperty(PropertyName = "pingUrlSuffix")]
 070        public string PingUrlSuffix { get; private set; }
 71
 72        /// <summary>
 73        /// Validate the object.
 74        /// </summary>
 75        /// <exception cref="ValidationException">
 76        /// Thrown if validation fails
 77        /// </exception>
 78        public virtual void Validate()
 79        {
 080            if (Token == null)
 81            {
 082                throw new ValidationException(ValidationRules.CannotBeNull, "Token");
 83            }
 084            if (Type == null)
 85            {
 086                throw new ValidationException(ValidationRules.CannotBeNull, "Type");
 87            }
 088            if (Suggestions != null)
 89            {
 090                foreach (var element in Suggestions)
 91                {
 092                    if (element != null)
 93                    {
 094                        element.Validate();
 95                    }
 96                }
 97            }
 098        }
 99    }
 100}