< Summary

Class:Microsoft.Azure.Search.Models.SoftDeleteColumnDeletionDetectionPolicy
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Customizations\DataSources\Models\SoftDeleteColumnDeletionDetectionPolicy.Customization.cs
C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\SoftDeleteColumnDeletionDetectionPolicy.cs
Covered lines:18
Uncovered lines:3
Coverable lines:21
Total lines:105
Line coverage:85.7% (18 of 21)
Covered branches:5
Total branches:10
Branch coverage:50% (5 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-76.92%50%
.ctor()-100%100%
.ctor(...)-100%100%
get_SoftDeleteColumnName()-100%100%
get_SoftDeleteMarkerValue()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Customizations\DataSources\Models\SoftDeleteColumnDeletionDetectionPolicy.Customization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5namespace Microsoft.Azure.Search.Models
 6{
 7    using Common;
 8
 9    public partial class SoftDeleteColumnDeletionDetectionPolicy
 10    {
 11        /// <summary>
 12        /// Initializes a new instance of the SoftDeleteColumnDeletionDetectionPolicy class with required arguments.
 13        /// </summary>
 14        /// <param name="softDeleteColumnName">
 15        /// Specifies the name of the column to use for soft-deletion detection.
 16        /// </param>
 17        /// <param name="softDeleteMarkerValue">
 18        /// Specifies the marker value that indentifies an item as deleted.
 19        /// </param>
 220        public SoftDeleteColumnDeletionDetectionPolicy(string softDeleteColumnName, object softDeleteMarkerValue)
 21        {
 222            Throw.IfArgumentNull(softDeleteColumnName, "softDeleteColumnName");
 223            Throw.IfArgumentNull(softDeleteMarkerValue, "softDeleteMarkerValue");
 24
 225            bool isValidType =
 226                softDeleteMarkerValue is int || softDeleteMarkerValue is long || softDeleteMarkerValue is byte ||
 227                softDeleteMarkerValue is short || softDeleteMarkerValue is string || softDeleteMarkerValue is bool;
 28
 229            Throw.IfArgument(
 230                !isValidType,
 231                "softDeleteMarkerValue",
 232                "Soft-delete marker value must be an integer, string, or bool value.");
 33
 034            this.SoftDeleteColumnName = softDeleteColumnName;
 035            this.SoftDeleteMarkerValue = softDeleteMarkerValue.ToString();
 036        }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\SoftDeleteColumnDeletionDetectionPolicy.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 Newtonsoft.Json;
 14    using System.Linq;
 15
 16    /// <summary>
 17    /// Defines a data deletion detection policy that implements a
 18    /// soft-deletion strategy. It determines whether an item should be deleted
 19    /// based on the value of a designated 'soft delete' column.
 20    /// </summary>
 21    [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy")]
 22    public partial class SoftDeleteColumnDeletionDetectionPolicy : DataDeletionDetectionPolicy
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the
 26        /// SoftDeleteColumnDeletionDetectionPolicy class.
 27        /// </summary>
 5028        public SoftDeleteColumnDeletionDetectionPolicy()
 29        {
 30            CustomInit();
 5031        }
 32
 33        /// <summary>
 34        /// Initializes a new instance of the
 35        /// SoftDeleteColumnDeletionDetectionPolicy class.
 36        /// </summary>
 37        /// <param name="softDeleteColumnName">The name of the column to use
 38        /// for soft-deletion detection.</param>
 39        /// <param name="softDeleteMarkerValue">The marker value that
 40        /// identifies an item as deleted.</param>
 641        public SoftDeleteColumnDeletionDetectionPolicy(string softDeleteColumnName = default(string), string softDeleteM
 42        {
 643            SoftDeleteColumnName = softDeleteColumnName;
 644            SoftDeleteMarkerValue = softDeleteMarkerValue;
 45            CustomInit();
 646        }
 47
 48        /// <summary>
 49        /// An initialization method that performs custom operations like setting defaults
 50        /// </summary>
 51        partial void CustomInit();
 52
 53        /// <summary>
 54        /// Gets or sets the name of the column to use for soft-deletion
 55        /// detection.
 56        /// </summary>
 57        [JsonProperty(PropertyName = "softDeleteColumnName")]
 15858        public string SoftDeleteColumnName { get; set; }
 59
 60        /// <summary>
 61        /// Gets or sets the marker value that identifies an item as deleted.
 62        /// </summary>
 63        [JsonProperty(PropertyName = "softDeleteMarkerValue")]
 15864        public string SoftDeleteMarkerValue { get; set; }
 65
 66    }
 67}