public void AssignVariation_assigns_second_experiment_variation_when_random_number_is_1() { var fakeAbTestingService = new FakeAbTestingService(); var abTest = new AbTest(fakeAbTestingService, new FakeRandomNumber(new[] { 1, 1 })); var variation = abTest.AssignVariation(MobileUserAgent); Assert.AreEqual(fakeAbTestingService.GetExperiments().ElementAt(1).Variations.ElementAt(1).Id, variation.Id); }
public void AssignVariation_assigns_first_experiment_variation_when_random_number_is_0() { var fakeAbTestingService = new FakeAbTestingService(); var abTest = new AbTest(fakeAbTestingService, new FakeRandomNumber(new [] { 0, 0 })); var variation = abTest.AssignVariation(MobileUserAgent); Assert.AreEqual(fakeAbTestingService.GetExperiments().First().Variations.First().Id, variation.Id); }