< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.TrendingVideosTile
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TrendingVideosTile.cs
Covered lines:5
Uncovered lines:11
Coverable lines:16
Total lines:71
Line coverage:31.2% (5 of 16)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\TrendingVideosTile.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.Linq;
 12
 13    public partial class TrendingVideosTile
 14    {
 15        /// <summary>
 16        /// Initializes a new instance of the TrendingVideosTile class.
 17        /// </summary>
 20218        public TrendingVideosTile()
 19        {
 20220            Query = new Query();
 21            CustomInit();
 20222        }
 23
 24        /// <summary>
 25        /// Initializes a new instance of the TrendingVideosTile class.
 26        /// </summary>
 027        public TrendingVideosTile(Query query, ImageObject image)
 28        {
 029            Query = query;
 030            Image = image;
 31            CustomInit();
 032        }
 33
 34        /// <summary>
 35        /// An initialization method that performs custom operations like setting defaults
 36        /// </summary>
 37        partial void CustomInit();
 38
 39        /// <summary>
 40        /// </summary>
 41        [JsonProperty(PropertyName = "query")]
 40842        public Query Query { get; set; }
 43
 44        /// <summary>
 45        /// </summary>
 46        [JsonProperty(PropertyName = "image")]
 40847        public ImageObject Image { get; set; }
 48
 49        /// <summary>
 50        /// Validate the object.
 51        /// </summary>
 52        /// <exception cref="ValidationException">
 53        /// Thrown if validation fails
 54        /// </exception>
 55        public virtual void Validate()
 56        {
 057            if (Query == null)
 58            {
 059                throw new ValidationException(ValidationRules.CannotBeNull, "Query");
 60            }
 061            if (Image == null)
 62            {
 063                throw new ValidationException(ValidationRules.CannotBeNull, "Image");
 64            }
 065            if (Query != null)
 66            {
 067                Query.Validate();
 68            }
 069        }
 70    }
 71}