< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingWebSearch\src\Generated\WebSearch\Models\RankingRankingGroup.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.WebSearch.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    /// Defines a search results group, such as mainline.
 17    /// </summary>
 18    public partial class RankingRankingGroup
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the RankingRankingGroup class.
 22        /// </summary>
 423        public RankingRankingGroup()
 24        {
 25            CustomInit();
 426        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the RankingRankingGroup class.
 30        /// </summary>
 31        /// <param name="items">A list of search result items to display in the
 32        /// group.</param>
 033        public RankingRankingGroup(IList<RankingRankingItem> items)
 34        {
 035            Items = items;
 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        /// Gets or sets a list of search result items to display in the group.
 46        /// </summary>
 47        [JsonProperty(PropertyName = "items")]
 848        public IList<RankingRankingItem> Items { 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 (Items == null)
 59            {
 060                throw new ValidationException(ValidationRules.CannotBeNull, "Items");
 61            }
 062            if (Items != null)
 63            {
 064                foreach (var element in Items)
 65                {
 066                    if (element != null)
 67                    {
 068                        element.Validate();
 69                    }
 70                }
 71            }
 072        }
 73    }
 74}