Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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;
            }
        }