< Summary

Class:Microsoft.Azure.CognitiveServices.Search.NewsSearch.Models.TrendingTopics
Assembly:Microsoft.Azure.CognitiveServices.Search.BingNewsSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingNewsSearch\src\Generated\NewsSearch\Models\TrendingTopics.cs
Covered lines:3
Uncovered lines:10
Coverable lines:13
Total lines:74
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_Value()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingNewsSearch\src\Generated\NewsSearch\Models\TrendingTopics.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.NewsSearch.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 TrendingTopics : Answer
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the TrendingTopics class.
 19        /// </summary>
 220        public TrendingTopics()
 21        {
 22            CustomInit();
 223        }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the TrendingTopics class.
 27        /// </summary>
 28        /// <param name="value">A list of trending news topics on Bing</param>
 29        /// <param name="id">A String identifier.</param>
 30        /// <param name="webSearchUrl">The URL To Bing's search result for this
 31        /// item.</param>
 32        public TrendingTopics(IList<NewsTopic> value, string id = default(string), string webSearchUrl = default(string)
 033            : base(id, webSearchUrl, followUpQueries)
 34        {
 035            Value = value;
 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 a list of trending news topics on Bing
 46        /// </summary>
 47        [JsonProperty(PropertyName = "value")]
 848        public IList<NewsTopic> Value { get; set; }
 49
 50        /// <summary>
 51        /// Validate the object.
 52        /// </summary>
 53        /// <exception cref="ValidationException">
 54        /// Thrown if validation fails
 55        /// </exception>
 56        public virtual void Validate()
 57        {
 058            if (Value == null)
 59            {
 060                throw new ValidationException(ValidationRules.CannotBeNull, "Value");
 61            }
 062            if (Value != null)
 63            {
 064                foreach (var element in Value)
 65                {
 066                    if (element != null)
 67                    {
 068                        element.Validate();
 69                    }
 70                }
 71            }
 072        }
 73    }
 74}