< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingImageSearch\src\Generated\ImageSearch\Models\TrendingImages.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.Collections;
 12    using System.Collections.Generic;
 13    using System.Linq;
 14
 15    /// <summary>
 16    /// The top-level object that the response includes when a trending images
 17    /// request succeeds.
 18    /// </summary>
 19    public partial class TrendingImages : Response
 20    {
 21        /// <summary>
 22        /// Initializes a new instance of the TrendingImages class.
 23        /// </summary>
 224        public TrendingImages()
 25        {
 26            CustomInit();
 227        }
 28
 29        /// <summary>
 30        /// Initializes a new instance of the TrendingImages class.
 31        /// </summary>
 32        /// <param name="categories">A list that identifies categories of
 33        /// images and a list of trending images in that category.</param>
 34        /// <param name="id">A String identifier.</param>
 35        /// <param name="readLink">The URL that returns this resource.</param>
 36        /// <param name="webSearchUrl">The URL To Bing's search result for this
 37        /// item.</param>
 38        public TrendingImages(IList<TrendingImagesCategory> categories, string id = default(string), string readLink = d
 039            : base(id, readLink, webSearchUrl)
 40        {
 041            Categories = categories;
 42            CustomInit();
 043        }
 44
 45        /// <summary>
 46        /// An initialization method that performs custom operations like setting defaults
 47        /// </summary>
 48        partial void CustomInit();
 49
 50        /// <summary>
 51        /// Gets or sets a list that identifies categories of images and a list
 52        /// of trending images in that category.
 53        /// </summary>
 54        [JsonProperty(PropertyName = "categories")]
 855        public IList<TrendingImagesCategory> Categories { get; set; }
 56
 57        /// <summary>
 58        /// Validate the object.
 59        /// </summary>
 60        /// <exception cref="ValidationException">
 61        /// Thrown if validation fails
 62        /// </exception>
 63        public virtual void Validate()
 64        {
 065            if (Categories == null)
 66            {
 067                throw new ValidationException(ValidationRules.CannotBeNull, "Categories");
 68            }
 069            if (Categories != null)
 70            {
 071                foreach (var element in Categories)
 72                {
 073                    if (element != null)
 74                    {
 075                        element.Validate();
 76                    }
 77                }
 78            }
 079        }
 80    }
 81}