< Summary

Class:Microsoft.Azure.CognitiveServices.Search.ImageSearch.Models.TrendingImagesTile
Assembly:Microsoft.Azure.CognitiveServices.Search.BingImageSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingImageSearch\src\Generated\ImageSearch\Models\TrendingImagesTile.cs
Covered lines:4
Uncovered lines:11
Coverable lines:15
Total lines:85
Line coverage:26.6% (4 of 15)
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.BingImageSearch\src\Generated\ImageSearch\Models\TrendingImagesTile.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.ImageSearch.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Linq;
 12
 13    /// <summary>
 14    /// Defines an image tile.
 15    /// </summary>
 16    public partial class TrendingImagesTile
 17    {
 18        /// <summary>
 19        /// Initializes a new instance of the TrendingImagesTile class.
 20        /// </summary>
 17021        public TrendingImagesTile()
 22        {
 23            CustomInit();
 17024        }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the TrendingImagesTile class.
 28        /// </summary>
 29        /// <param name="query">A query that returns a Bing search results page
 30        /// with more images of the subject. For example, if the category is
 31        /// Popular People Searches, then the thumbnail is of a popular person.
 32        /// The query would return a Bing search results page with more images
 33        /// of that person.</param>
 34        /// <param name="image">The image's thumbnail.</param>
 035        public TrendingImagesTile(Query query, ImageObject image)
 36        {
 037            Query = query;
 038            Image = image;
 39            CustomInit();
 040        }
 41
 42        /// <summary>
 43        /// An initialization method that performs custom operations like setting defaults
 44        /// </summary>
 45        partial void CustomInit();
 46
 47        /// <summary>
 48        /// Gets or sets a query that returns a Bing search results page with
 49        /// more images of the subject. For example, if the category is Popular
 50        /// People Searches, then the thumbnail is of a popular person. The
 51        /// query would return a Bing search results page with more images of
 52        /// that person.
 53        /// </summary>
 54        [JsonProperty(PropertyName = "query")]
 34255        public Query Query { get; set; }
 56
 57        /// <summary>
 58        /// Gets or sets the image's thumbnail.
 59        /// </summary>
 60        [JsonProperty(PropertyName = "image")]
 34261        public ImageObject Image { get; set; }
 62
 63        /// <summary>
 64        /// Validate the object.
 65        /// </summary>
 66        /// <exception cref="ValidationException">
 67        /// Thrown if validation fails
 68        /// </exception>
 69        public virtual void Validate()
 70        {
 071            if (Query == null)
 72            {
 073                throw new ValidationException(ValidationRules.CannotBeNull, "Query");
 74            }
 075            if (Image == null)
 76            {
 077                throw new ValidationException(ValidationRules.CannotBeNull, "Image");
 78            }
 079            if (Query != null)
 80            {
 081                Query.Validate();
 82            }
 083        }
 84    }
 85}