< Summary

Class:Microsoft.Azure.Search.Models.DistanceScoringParameters
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\DistanceScoringParameters.cs
Covered lines:10
Uncovered lines:1
Coverable lines:11
Total lines:77
Line coverage:90.9% (10 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(...)-100%100%
get_ReferencePointParameter()-100%100%
get_BoostingDistance()-100%100%
Validate()-66.67%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\DistanceScoringParameters.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    /// Provides parameter values to a distance scoring function.
 19    /// </summary>
 20    public partial class DistanceScoringParameters
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the DistanceScoringParameters class.
 24        /// </summary>
 48625        public DistanceScoringParameters()
 26        {
 27            CustomInit();
 48628        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the DistanceScoringParameters class.
 32        /// </summary>
 33        /// <param name="referencePointParameter">The name of the parameter
 34        /// passed in search queries to specify the reference location.</param>
 35        /// <param name="boostingDistance">The distance in kilometers from the
 36        /// reference location where the boosting range ends.</param>
 47837        public DistanceScoringParameters(string referencePointParameter, double boostingDistance)
 38        {
 47839            ReferencePointParameter = referencePointParameter;
 47840            BoostingDistance = boostingDistance;
 41            CustomInit();
 47842        }
 43
 44        /// <summary>
 45        /// An initialization method that performs custom operations like setting defaults
 46        /// </summary>
 47        partial void CustomInit();
 48
 49        /// <summary>
 50        /// Gets or sets the name of the parameter passed in search queries to
 51        /// specify the reference location.
 52        /// </summary>
 53        [JsonProperty(PropertyName = "referencePointParameter")]
 194454        public string ReferencePointParameter { get; set; }
 55
 56        /// <summary>
 57        /// Gets or sets the distance in kilometers from the reference location
 58        /// where the boosting range ends.
 59        /// </summary>
 60        [JsonProperty(PropertyName = "boostingDistance")]
 146461        public double BoostingDistance { get; set; }
 62
 63        /// <summary>
 64        /// Validate the object.
 65        /// </summary>
 66        /// <exception cref="ValidationException">
 67        /// Thrown if validation fails
 68        /// </exception>
 69        public virtual void Validate()
 70        {
 48071            if (ReferencePointParameter == null)
 72            {
 073                throw new ValidationException(ValidationRules.CannotBeNull, "ReferencePointParameter");
 74            }
 48075        }
 76    }
 77}