< Summary

Class:Microsoft.Azure.CognitiveServices.Search.WebSearch.Models.RelatedSearchesRelatedSearchAnswer
Assembly:Microsoft.Azure.CognitiveServices.Search.BingWebSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingWebSearch\src\Generated\WebSearch\Models\RelatedSearchesRelatedSearchAnswer.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:85
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingWebSearch\src\Generated\WebSearch\Models\RelatedSearchesRelatedSearchAnswer.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.WebSearch.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    /// <summary>
 16    /// Defines a list of related queries made by others.
 17    /// </summary>
 18    [Newtonsoft.Json.JsonObject("RelatedSearches/RelatedSearchAnswer")]
 19    public partial class RelatedSearchesRelatedSearchAnswer : SearchResultsAnswer
 20    {
 21        /// <summary>
 22        /// Initializes a new instance of the
 23        /// RelatedSearchesRelatedSearchAnswer class.
 24        /// </summary>
 025        public RelatedSearchesRelatedSearchAnswer()
 26        {
 27            CustomInit();
 028        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the
 32        /// RelatedSearchesRelatedSearchAnswer class.
 33        /// </summary>
 34        /// <param name="value">A list of related queries that were made by
 35        /// others.</param>
 36        /// <param name="id">A String identifier.</param>
 37        /// <param name="webSearchUrl">The URL To Bing's search result for this
 38        /// item.</param>
 39        /// <param name="totalEstimatedMatches">The estimated number of
 40        /// webpages that are relevant to the query. Use this number along with
 41        /// the count and offset query parameters to page the results.</param>
 42        public RelatedSearchesRelatedSearchAnswer(IList<Query> value, string id = default(string), string webSearchUrl =
 043            : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly)
 44        {
 045            Value = value;
 46            CustomInit();
 047        }
 48
 49        /// <summary>
 50        /// An initialization method that performs custom operations like setting defaults
 51        /// </summary>
 52        partial void CustomInit();
 53
 54        /// <summary>
 55        /// Gets or sets a list of related queries that were made by others.
 56        /// </summary>
 57        [JsonProperty(PropertyName = "value")]
 058        public IList<Query> Value { get; set; }
 59
 60        /// <summary>
 61        /// Validate the object.
 62        /// </summary>
 63        /// <exception cref="ValidationException">
 64        /// Thrown if validation fails
 65        /// </exception>
 66        public override void Validate()
 67        {
 068            base.Validate();
 069            if (Value == null)
 70            {
 071                throw new ValidationException(ValidationRules.CannotBeNull, "Value");
 72            }
 073            if (Value != null)
 74            {
 075                foreach (var element in Value)
 76                {
 077                    if (element != null)
 78                    {
 079                        element.Validate();
 80                    }
 81                }
 82            }
 083        }
 84    }
 85}