Exemple #1
0
        public void Given_a_0_Percent_Should_Not_Be_Traget()
        {
            var userTargetting = new UserTargeting
            {
                EnvironmentId = System.Guid.Empty
            };
            var target = TargetPercentage.New(0, userTargetting);

            Assert.IsFalse(target.IsTarget(new TargetUser("12345678")));
        }
Exemple #2
0
 private static RuleDto New(bool isEnabled, TargetPercentage rule)
 {
     return(new RuleDto
     {
         IsEnabled = isEnabled,
         EnabledFor = new EnabledForDto
         {
             Name = rule.Name,
             Parameters = new Dictionary <string, object> {
                 { "percent", rule.Percent.Number }
             },
         }
     });
 }