< Summary

Class:Microsoft.Azure.Search.Models.InputFieldMappingEntry
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\InputFieldMappingEntry.cs
Covered lines:12
Uncovered lines:7
Coverable lines:19
Total lines:105
Line coverage:63.1% (12 of 19)
Covered branches:7
Total branches:8
Branch coverage:87.5% (7 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Name()-100%100%
get_Source()-100%100%
get_SourceContext()-100%100%
get_Inputs()-100%100%
Validate()-85.71%87.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\InputFieldMappingEntry.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Search.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Input field mapping for a skill.
 21    /// </summary>
 22    public partial class InputFieldMappingEntry
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the InputFieldMappingEntry class.
 26        /// </summary>
 36827        public InputFieldMappingEntry()
 28        {
 29            CustomInit();
 36830        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the InputFieldMappingEntry class.
 34        /// </summary>
 35        /// <param name="name">The name of the input.</param>
 36        /// <param name="source">The source of the input.</param>
 37        /// <param name="sourceContext">The source context used for selecting
 38        /// recursive inputs.</param>
 39        /// <param name="inputs">The recursive inputs used when creating a
 40        /// complex type.</param>
 041        public InputFieldMappingEntry(string name, string source = default(string), string sourceContext = default(strin
 42        {
 043            Name = name;
 044            Source = source;
 045            SourceContext = sourceContext;
 046            Inputs = inputs;
 47            CustomInit();
 048        }
 49
 50        /// <summary>
 51        /// An initialization method that performs custom operations like setting defaults
 52        /// </summary>
 53        partial void CustomInit();
 54
 55        /// <summary>
 56        /// Gets or sets the name of the input.
 57        /// </summary>
 58        [JsonProperty(PropertyName = "name")]
 102859        public string Name { get; set; }
 60
 61        /// <summary>
 62        /// Gets or sets the source of the input.
 63        /// </summary>
 64        [JsonProperty(PropertyName = "source")]
 84465        public string Source { get; set; }
 66
 67        /// <summary>
 68        /// Gets or sets the source context used for selecting recursive
 69        /// inputs.
 70        /// </summary>
 71        [JsonProperty(PropertyName = "sourceContext")]
 48472        public string SourceContext { get; set; }
 73
 74        /// <summary>
 75        /// Gets or sets the recursive inputs used when creating a complex
 76        /// type.
 77        /// </summary>
 78        [JsonProperty(PropertyName = "inputs")]
 104879        public IList<InputFieldMappingEntry> Inputs { get; set; }
 80
 81        /// <summary>
 82        /// Validate the object.
 83        /// </summary>
 84        /// <exception cref="ValidationException">
 85        /// Thrown if validation fails
 86        /// </exception>
 87        public virtual void Validate()
 88        {
 18089            if (Name == null)
 90            {
 091                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 92            }
 18093            if (Inputs != null)
 94            {
 1295                foreach (var element in Inputs)
 96                {
 497                    if (element != null)
 98                    {
 499                        element.Validate();
 100                    }
 101                }
 102            }
 180103        }
 104    }
 105}