< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_FlaggedTokens()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.SpellCheck\src\Generated\Models\SpellCheckModel.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    [Newtonsoft.Json.JsonObject("SpellCheck")]
 16    public partial class SpellCheckModel : Answer
 17    {
 18        /// <summary>
 19        /// Initializes a new instance of the SpellCheckModel class.
 20        /// </summary>
 121        public SpellCheckModel()
 22        {
 23            CustomInit();
 124        }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the SpellCheckModel class.
 28        /// </summary>
 29        /// <param name="id">A String identifier.</param>
 30        public SpellCheckModel(IList<SpellingFlaggedToken> flaggedTokens, string id = default(string))
 031            : base(id)
 32        {
 033            FlaggedTokens = flaggedTokens;
 34            CustomInit();
 035        }
 36
 37        /// <summary>
 38        /// An initialization method that performs custom operations like setting defaults
 39        /// </summary>
 40        partial void CustomInit();
 41
 42        /// <summary>
 43        /// </summary>
 44        [JsonProperty(PropertyName = "flaggedTokens")]
 445        public IList<SpellingFlaggedToken> FlaggedTokens { get; set; }
 46
 47        /// <summary>
 48        /// Validate the object.
 49        /// </summary>
 50        /// <exception cref="ValidationException">
 51        /// Thrown if validation fails
 52        /// </exception>
 53        public virtual void Validate()
 54        {
 055            if (FlaggedTokens == null)
 56            {
 057                throw new ValidationException(ValidationRules.CannotBeNull, "FlaggedTokens");
 58            }
 059            if (FlaggedTokens != null)
 60            {
 061                foreach (var element in FlaggedTokens)
 62                {
 063                    if (element != null)
 64                    {
 065                        element.Validate();
 66                    }
 67                }
 68            }
 069        }
 70    }
 71}