< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.TrendingVideos
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TrendingVideos.cs
Covered lines:4
Uncovered lines:17
Coverable lines:21
Total lines:92
Line coverage:19% (4 of 21)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TrendingVideos.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.VideoSearch.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 TrendingVideos : Response
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the TrendingVideos class.
 19        /// </summary>
 220        public TrendingVideos()
 21        {
 22            CustomInit();
 223        }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the TrendingVideos class.
 27        /// </summary>
 28        /// <param name="id">A String identifier.</param>
 29        /// <param name="webSearchUrl">The URL To Bing's search result for this
 30        /// item.</param>
 31        public TrendingVideos(IList<TrendingVideosTile> bannerTiles, IList<TrendingVideosCategory> categories, string id
 032            : base(id, webSearchUrl)
 33        {
 034            BannerTiles = bannerTiles;
 035            Categories = categories;
 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 = "bannerTiles")]
 847        public IList<TrendingVideosTile> BannerTiles { get; set; }
 48
 49        /// <summary>
 50        /// </summary>
 51        [JsonProperty(PropertyName = "categories")]
 852        public IList<TrendingVideosCategory> Categories { get; set; }
 53
 54        /// <summary>
 55        /// Validate the object.
 56        /// </summary>
 57        /// <exception cref="ValidationException">
 58        /// Thrown if validation fails
 59        /// </exception>
 60        public virtual void Validate()
 61        {
 062            if (BannerTiles == null)
 63            {
 064                throw new ValidationException(ValidationRules.CannotBeNull, "BannerTiles");
 65            }
 066            if (Categories == null)
 67            {
 068                throw new ValidationException(ValidationRules.CannotBeNull, "Categories");
 69            }
 070            if (BannerTiles != null)
 71            {
 072                foreach (var element in BannerTiles)
 73                {
 074                    if (element != null)
 75                    {
 076                        element.Validate();
 77                    }
 78                }
 79            }
 080            if (Categories != null)
 81            {
 082                foreach (var element1 in Categories)
 83                {
 084                    if (element1 != null)
 85                    {
 086                        element1.Validate();
 87                    }
 88                }
 89            }
 090        }
 91    }
 92}