< Summary

Class:Microsoft.Azure.Search.Models.OutputFieldMappingEntry
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\OutputFieldMappingEntry.cs
Covered lines:6
Uncovered lines:5
Coverable lines:11
Total lines:79
Line coverage:54.5% (6 of 11)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Name()-100%100%
get_TargetName()-100%100%
Validate()-66.67%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\OutputFieldMappingEntry.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.Linq;
 16
 17    /// <summary>
 18    /// Output field mapping for a skill.
 19    /// <see
 20    /// href="https://docs.microsoft.com/rest/api/searchservice/naming-rules"
 21    /// />
 22    /// </summary>
 23    public partial class OutputFieldMappingEntry
 24    {
 25        /// <summary>
 26        /// Initializes a new instance of the OutputFieldMappingEntry class.
 27        /// </summary>
 26228        public OutputFieldMappingEntry()
 29        {
 30            CustomInit();
 26231        }
 32
 33        /// <summary>
 34        /// Initializes a new instance of the OutputFieldMappingEntry class.
 35        /// </summary>
 36        /// <param name="name">The name of the output defined by the
 37        /// skill.</param>
 38        /// <param name="targetName">The target name of the output. It is
 39        /// optional and default to name.</param>
 040        public OutputFieldMappingEntry(string name, string targetName = default(string))
 41        {
 042            Name = name;
 043            TargetName = targetName;
 44            CustomInit();
 045        }
 46
 47        /// <summary>
 48        /// An initialization method that performs custom operations like setting defaults
 49        /// </summary>
 50        partial void CustomInit();
 51
 52        /// <summary>
 53        /// Gets or sets the name of the output defined by the skill.
 54        /// </summary>
 55        [JsonProperty(PropertyName = "name")]
 74256        public string Name { get; set; }
 57
 58        /// <summary>
 59        /// Gets or sets the target name of the output. It is optional and
 60        /// default to name.
 61        /// </summary>
 62        [JsonProperty(PropertyName = "targetName")]
 61463        public string TargetName { get; set; }
 64
 65        /// <summary>
 66        /// Validate the object.
 67        /// </summary>
 68        /// <exception cref="ValidationException">
 69        /// Thrown if validation fails
 70        /// </exception>
 71        public virtual void Validate()
 72        {
 12873            if (Name == null)
 74            {
 075                throw new ValidationException(ValidationRules.CannotBeNull, "Name");
 76            }
 12877        }
 78    }
 79}