< Summary

Class:Microsoft.Azure.CognitiveServices.Search.AutoSuggest.Models.SuggestionsSuggestionGroup
Assembly:Microsoft.Azure.CognitiveServices.Search.BingAutoSuggest
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingAutoSuggest\src\Generated\AutoSuggest\Models\SuggestionsSuggestionGroup.cs
Covered lines:3
Uncovered lines:10
Coverable lines:13
Total lines:75
Line coverage:23% (3 of 13)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingAutoSuggest\src\Generated\AutoSuggest\Models\SuggestionsSuggestionGroup.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    [Newtonsoft.Json.JsonObject("Suggestions/SuggestionGroup")]
 16    public partial class SuggestionsSuggestionGroup
 17    {
 18        /// <summary>
 19        /// Initializes a new instance of the SuggestionsSuggestionGroup class.
 20        /// </summary>
 221        public SuggestionsSuggestionGroup()
 22        {
 23            CustomInit();
 224        }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the SuggestionsSuggestionGroup class.
 28        /// </summary>
 29        /// <param name="name">Possible values include: 'Unknown', 'Web',
 30        /// 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments',
 31        /// 'PersonalSearchTags', 'Custom'</param>
 032        public SuggestionsSuggestionGroup(string name, IList<SearchAction> searchSuggestions)
 33        {
 034            Name = name;
 035            SearchSuggestions = searchSuggestions;
 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        /// Gets or sets possible values include: 'Unknown', 'Web',
 46        /// 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments',
 47        /// 'PersonalSearchTags', 'Custom'
 48        /// </summary>
 49        [JsonProperty(PropertyName = "name")]
 050        public string Name { get; set; }
 51
 52        /// <summary>
 53        /// </summary>
 54        [JsonProperty(PropertyName = "searchSuggestions")]
 455        public IList<SearchAction> SearchSuggestions { get; set; }
 56
 57        /// <summary>
 58        /// Validate the object.
 59        /// </summary>
 60        /// <exception cref="ValidationException">
 61        /// Thrown if validation fails
 62        /// </exception>
 63        public virtual void Validate()
 64        {
 065            if (Name == null)
 66            {
 067                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 68            }
 069            if (SearchSuggestions == null)
 70            {
 071                throw new ValidationException(ValidationRules.CannotBeNull, "SearchSuggestions");
 72            }
 073        }
 74    }
 75}