public void use_descriptor_with_activator_name_equals_to_activator_type_name() { var activator = new RolloutUserNameActivatorBuilder() .WithActiveUsers(new string[] { "user1" }) .WithRuntimeParameters(new Dictionary <string, object>() { { "percentage", 0d } }) .Build(); var typeName = typeof(RolloutUsernameActivator).Name; activator.Descriptors .ToList() .ForEach(d => d.ActivatorName.Should().BeEquivalentTo(typeName)); }
public async Task be_not_active_when_percentage_is_0() { var activator = new RolloutUserNameActivatorBuilder() .WithRuntimeParameters(new Dictionary <string, object>() { { "percentage", 0d } }) .WithActiveUsers(new string[] { "user1" }) .Build(); int index = 0; while (index < 100) { (await activator.IsActiveAsync("feature")).Should().Be(false); ++index; } }
public async Task indicates_whether_activator_is_active() { var activator = new RolloutUserNameActivatorBuilder() .WithRuntimeParameters(new Dictionary <string, object>() { { "percentage", 50d } }) .WithActiveUsers(new string[] { "user_selected_to_be_on_first_part" }) .Build(); int index = 0; while (index < 100) { (await activator.IsActiveAsync("feature")).Should().Be(true); ++index; } }