< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TrendingVideosSubcategory.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 TrendingVideosSubcategory
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the TrendingVideosSubcategory class.
 19        /// </summary>
 2420        public TrendingVideosSubcategory()
 21        {
 22            CustomInit();
 2423        }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the TrendingVideosSubcategory class.
 27        /// </summary>
 028        public TrendingVideosSubcategory(string title, IList<TrendingVideosTile> tiles)
 29        {
 030            Title = title;
 031            Tiles = tiles;
 32            CustomInit();
 033        }
 34
 35        /// <summary>
 36        /// An initialization method that performs custom operations like setting defaults
 37        /// </summary>
 38        partial void CustomInit();
 39
 40        /// <summary>
 41        /// </summary>
 42        [JsonProperty(PropertyName = "title")]
 2643        public string Title { get; set; }
 44
 45        /// <summary>
 46        /// </summary>
 47        [JsonProperty(PropertyName = "tiles")]
 5448        public IList<TrendingVideosTile> Tiles { 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 (Title == null)
 59            {
 060                throw new ValidationException(ValidationRules.CannotBeNull, "Title");
 61            }
 062            if (Tiles == null)
 63            {
 064                throw new ValidationException(ValidationRules.CannotBeNull, "Tiles");
 65            }
 066            if (Tiles != null)
 67            {
 068                foreach (var element in Tiles)
 69                {
 070                    if (element != null)
 71                    {
 072                        element.Validate();
 73                    }
 74                }
 75            }
 076        }
 77    }
 78}