/// <summary>
 /// Initializes a new instance of the
 /// DataMaskingRuleCreateOrUpdateParameters class with required
 /// arguments.
 /// </summary>
 public DataMaskingRuleCreateOrUpdateParameters(DataMaskingRuleProperties properties)
     : this()
 {
     if (properties == null)
     {
         throw new ArgumentNullException("properties");
     }
     this.Properties = properties;
 }
 /// <summary>
 /// Initializes a new instance of the
 /// DataMaskingRuleCreateOrUpdateParameters class with required
 /// arguments.
 /// </summary>
 public DataMaskingRuleCreateOrUpdateParameters(DataMaskingRuleProperties properties)
     : this()
 {
     if (properties == null)
     {
         throw new ArgumentNullException("properties");
     }
     this.Properties = properties;
 }
 /// <summary>
 /// Takes the cmdlets model object and transform it to the policy as expected by the endpoint
 /// </summary>
 /// <param name="model">The data masking Policy model object</param>
 /// <returns>The communication model object</returns>
 private DataMaskingRuleCreateOrUpdateParameters PolicizeDatabaseDataRuleModel(DatabaseDataMaskingRuleModel model)
 {
     DataMaskingRuleCreateOrUpdateParameters updateParameters = new DataMaskingRuleCreateOrUpdateParameters();
     DataMaskingRuleProperties properties = new DataMaskingRuleProperties();
     updateParameters.Properties = properties;
     properties.Id = ExtractDataMaskingRuleId(model);
     properties.TableName = model.TableName;
     properties.SchemaName = model.SchemaName;
     properties.ColumnName = model.ColumnName;
     properties.MaskingFunction = PolicizeMaskingFunction(model.MaskingFunction);
     properties.PrefixSize = (model.PrefixSize == null) ? null : model.PrefixSize.ToString();
     properties.ReplacementString = model.ReplacementString;
     properties.SuffixSize = (model.SuffixSize == null) ? null : model.SuffixSize.ToString();
     properties.NumberFrom = (model.NumberFrom == null) ? null : model.NumberFrom.ToString();
     properties.NumberTo = (model.NumberTo == null) ? null : model.NumberTo.ToString();
     properties.RuleState = SecurityConstants.Enabled;
     return updateParameters;
 }
 /// <summary>
 /// Create a data masking rule
 /// </summary>
 /// <param name="uniqueId">A unique id to act as a seed for the ruleId, the masked table name and the masked column name</param>
 /// <returns>A DataMaskingRuleProperties describing the rule</returns>
 private DataMaskingRuleProperties MakeRuleProperties(int uniqueId, string table, string column)
 {
     DataMaskingRuleProperties props = new DataMaskingRuleProperties();
     props.Id = "ruleId" + uniqueId;
     props.SchemaName = "DBO";
     props.TableName = table;
     props.ColumnName = column;
     props.MaskingFunction = "Default";
     props.NumberFrom = null;
     props.NumberTo = null;
     props.PrefixSize = null;
     props.SuffixSize = null;
     props.ReplacementString = null;
     return props;
 }
 /// <summary>
 /// Verify that the received properties match their expected values
 /// </summary>
 /// <param name="actual">The properties object that needs to be checked</param>
 /// <param name="expected">The expected value of the properties object</param>
 private static void VerifyDataMaskingRuleInformation(DataMaskingRuleProperties actual, DataMaskingRuleProperties expected)
 {
     Assert.Equal(expected.Id, actual.Id);
     Assert.Equal(expected.TableName, actual.TableName);
     Assert.Equal(expected.ColumnName, actual.ColumnName);   
     Assert.Equal(expected.MaskingFunction, actual.MaskingFunction);
     Assert.Equal(expected.NumberFrom, actual.NumberFrom);
     Assert.Equal(expected.NumberTo, actual.NumberTo);
     Assert.Equal(expected.PrefixSize, actual.PrefixSize);
     Assert.Equal(expected.ReplacementString, actual.ReplacementString);
     Assert.Equal(expected.SuffixSize, actual.SuffixSize);
 }
 /// <summary>
 /// Create a data masking rule
 /// </summary>
 /// <param name="uniqueId">A unique id to act as a seed for the ruleId, the masked table name and the masked column name</param>
 /// <returns>A DataMaskingRuleProperties describing the rule</returns>
 private DataMaskingRuleProperties MakeRuleProperties(int uniqueId)
 {
     DataMaskingRuleProperties props = new DataMaskingRuleProperties();
     props.Id = "ruleId" + uniqueId;
     props.TableName = "t-name " + uniqueId;
     props.ColumnName = "col-name " + uniqueId;
     props.AliasName = null;
     props.MaskingFunction = "Default";
     props.NumberFrom = null;
     props.NumberTo = null;
     props.PrefixSize = null;
     props.SuffixSize = null;
     props.ReplacementString = null;
     return props;
 }