< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.PivotSuggestions
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\PivotSuggestions.cs
Covered lines:3
Uncovered lines:14
Coverable lines:17
Total lines:78
Line coverage:17.6% (3 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_Pivot()-0%100%
get_Suggestions()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\PivotSuggestions.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 PivotSuggestions
 16    {
 17        /// <summary>
 18        /// Initializes a new instance of the PivotSuggestions class.
 19        /// </summary>
 220        public PivotSuggestions()
 21        {
 22            CustomInit();
 223        }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the PivotSuggestions class.
 27        /// </summary>
 028        public PivotSuggestions(string pivot, IList<Query> suggestions)
 29        {
 030            Pivot = pivot;
 031            Suggestions = suggestions;
 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 = "pivot")]
 043        public string Pivot { get; set; }
 44
 45        /// <summary>
 46        /// </summary>
 47        [JsonProperty(PropertyName = "suggestions")]
 448        public IList<Query> Suggestions { 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 (Pivot == null)
 59            {
 060                throw new ValidationException(ValidationRules.CannotBeNull, "Pivot");
 61            }
 062            if (Suggestions == null)
 63            {
 064                throw new ValidationException(ValidationRules.CannotBeNull, "Suggestions");
 65            }
 066            if (Suggestions != null)
 67            {
 068                foreach (var element in Suggestions)
 69                {
 070                    if (element != null)
 71                    {
 072                        element.Validate();
 73                    }
 74                }
 75            }
 076        }
 77    }
 78}