public ABsoluteMaybeStatisticsResult(bool insufficientSampleSize,
			                                     double confidenceLevel,
			                                     Experiment.Option bestOption,
			                                     Experiment.Option worstOption)
            {
                InsufficientSampleSize = insufficientSampleSize;
                ConfidenceLevel = confidenceLevel;
                BestOption = bestOption;
                WorstOption = worstOption;
            }
        public void ShouldWork()
        {
            //arrange
            var participants = CreateRandomParticipationRecords(100, 200);
            var exp = new Experiment(null, null, null, DateTime.Now, null, participants, new[] { "false", "true" });

            //act
            var stats = new ABsoluteMaybeStatistics(exp);
            var formatted = new ABingoStyleFormatter(stats);

            //assert
            formatted.ShouldNotBeNull();
            formatted.ToString().ShouldNotEqual(string.Empty);
        }
Esempio n. 3
0
        public void OptionConversionRateIsCountedProperly()
        {
            //arrange
            var participants = new[]
                               	{
                               		new ParticipationRecord("user1", "OPTION_1", false, null),
                                    new ParticipationRecord("user2", "OPTION_1", true, DateTime.Now),
                                    new ParticipationRecord("user3", "OPTION_1", false, null),
                                    new ParticipationRecord("user4", "OPTION_1", true, DateTime.Now)
                               	};
            var exp = new Experiment(null, null, null, DateTime.Now, null, participants, new[] { "OPTION_1", "OPTION_2" });

            //act
            var options = exp.Options;

            //assert
            options.ElementAt(0).ConversionRate.ShouldEqual(.5);
        }
Esempio n. 4
0
        public void OptionParticipantsAreCountedProperly()
        {
            //arrange
            var participants = new[]
                               	{
                               		new ParticipationRecord("user1", "OPTION_1", false, null),
                                    new ParticipationRecord("user2", "OPTION_1", false, null),
                                    new ParticipationRecord("user1", "OPTION_2", false, null),
                                    new ParticipationRecord("user2", "OPTION_2", false, null),
                                    new ParticipationRecord("user3", "OPTION_2", false, null),
                               	};
            var exp = new Experiment(null, null, null, DateTime.Now, null, participants, new[] { "OPTION_1", "OPTION_2" });

            //act
            var options = exp.Options;

            //assert
            options.ElementAt(0).Participants.ShouldEqual(2);
            options.ElementAt(1).Participants.ShouldEqual(3);
        }
 public ABsoluteMaybeStatistics(Experiment experiment)
 {
     _experiment = experiment;
 }
Esempio n. 6
0
        public void OptionsIncludesOptionValuesThatHaventBeenUsedByAnyParticipants()
        {
            //arrange
            var participants = new[]
                               	{
                               		new ParticipationRecord("user1", "OPTION_1", false, null),
                                    new ParticipationRecord("user2", "OPTION_1", false, null),
                               	};
            var exp = new Experiment(null, null, null, DateTime.Now, null, participants, new[] { "OPTION_1", "OPTION_2" });

            //act
            var options = exp.Options;

            //assert
            options.Count().ShouldEqual(2);
        }