< Summary

Class:Microsoft.Azure.CognitiveServices.Search.AutoSuggest.Models.Suggestions
Assembly:Microsoft.Azure.CognitiveServices.Search.BingAutoSuggest
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingAutoSuggest\src\Generated\AutoSuggest\Models\Suggestions.cs
Covered lines:3
Uncovered lines:11
Coverable lines:14
Total lines:74
Line coverage:21.4% (3 of 14)
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_SuggestionGroups()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingAutoSuggest\src\Generated\AutoSuggest\Models\Suggestions.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.Search.AutoSuggest.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 Suggestions : SearchResultsAnswer
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the Suggestions class.
 19        /// </summary>
 220        public Suggestions()
 21        {
 22            CustomInit();
 223        }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the Suggestions class.
 27        /// </summary>
 28        /// <param name="id">A String identifier.</param>
 29        /// <param name="readLink">The URL that returns this resource.</param>
 30        /// <param name="webSearchUrl">The URL To Bing's search result for this
 31        /// item.</param>
 32        public Suggestions(IList<SuggestionsSuggestionGroup> suggestionGroups, string id = default(string), string readL
 033            : base(id, readLink, webSearchUrl, potentialAction, immediateAction, preferredClickthroughUrl, adaptiveCard,
 34        {
 035            SuggestionGroups = suggestionGroups;
 36            CustomInit();
 037        }
 38
 39        /// <summary>
 40        /// An initialization method that performs custom operations like setting defaults
 41        /// </summary>
 42        partial void CustomInit();
 43
 44        /// <summary>
 45        /// </summary>
 46        [JsonProperty(PropertyName = "suggestionGroups")]
 847        public IList<SuggestionsSuggestionGroup> SuggestionGroups { get; set; }
 48
 49        /// <summary>
 50        /// Validate the object.
 51        /// </summary>
 52        /// <exception cref="ValidationException">
 53        /// Thrown if validation fails
 54        /// </exception>
 55        public override void Validate()
 56        {
 057            base.Validate();
 058            if (SuggestionGroups == null)
 59            {
 060                throw new ValidationException(ValidationRules.CannotBeNull, "SuggestionGroups");
 61            }
 062            if (SuggestionGroups != null)
 63            {
 064                foreach (var element in SuggestionGroups)
 65                {
 066                    if (element != null)
 67                    {
 068                        element.Validate();
 69                    }
 70                }
 71            }
 072        }
 73    }
 74}