< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingWebSearch\src\Generated\WebSearch\Models\Videos.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 video answer.
 17    /// </summary>
 18    public partial class Videos : SearchResultsAnswer
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the Videos class.
 22        /// </summary>
 223        public Videos()
 24        {
 25            CustomInit();
 226        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the Videos class.
 30        /// </summary>
 31        /// <param name="value">A list of video objects that are relevant to
 32        /// the query.</param>
 33        /// <param name="id">A String identifier.</param>
 34        /// <param name="webSearchUrl">The URL To Bing's search result for this
 35        /// item.</param>
 36        /// <param name="totalEstimatedMatches">The estimated number of
 37        /// webpages that are relevant to the query. Use this number along with
 38        /// the count and offset query parameters to page the results.</param>
 39        public Videos(IList<VideoObject> value, string id = default(string), string webSearchUrl = default(string), ILis
 040            : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly)
 41        {
 042            Value = value;
 043            NextOffset = nextOffset;
 044            QueryExpansions = queryExpansions;
 045            RelatedSearches = relatedSearches;
 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 video objects that are relevant to the
 56        /// query.
 57        /// </summary>
 58        [JsonProperty(PropertyName = "value")]
 059        public IList<VideoObject> Value { get; set; }
 60
 61        /// <summary>
 62        /// </summary>
 63        [JsonProperty(PropertyName = "nextOffset")]
 064        public int? NextOffset { get; private set; }
 65
 66        /// <summary>
 67        /// </summary>
 68        [JsonProperty(PropertyName = "queryExpansions")]
 069        public IList<Query> QueryExpansions { get; private set; }
 70
 71        /// <summary>
 72        /// </summary>
 73        [JsonProperty(PropertyName = "relatedSearches")]
 074        public IList<Query> RelatedSearches { get; private set; }
 75
 76        /// <summary>
 77        /// Validate the object.
 78        /// </summary>
 79        /// <exception cref="ValidationException">
 80        /// Thrown if validation fails
 81        /// </exception>
 82        public override void Validate()
 83        {
 084            base.Validate();
 085            if (Value == null)
 86            {
 087                throw new ValidationException(ValidationRules.CannotBeNull, "Value");
 88            }
 089            if (QueryExpansions != null)
 90            {
 091                foreach (var element in QueryExpansions)
 92                {
 093                    if (element != null)
 94                    {
 095                        element.Validate();
 96                    }
 97                }
 98            }
 099            if (RelatedSearches != null)
 100            {
 0101                foreach (var element1 in RelatedSearches)
 102                {
 0103                    if (element1 != null)
 104                    {
 0105                        element1.Validate();
 106                    }
 107                }
 108            }
 0109        }
 110    }
 111}