Beispiel #1
0
        public void ShouldBeDefaultValueWhenNull()
        {
            var input = new ThresholdHighInput {
                SuppliedInput = null
            };
            var options = input.Validate(low: 60);

            options.ShouldBe(input.Default.Value);
        }
Beispiel #2
0
        public void ShouldAllow100()
        {
            var input = 100;
            var options = new ThresholdHighInput {
                SuppliedInput = input
            }.Validate(low: 60);

            options.ShouldBe(input);
        }
Beispiel #3
0
        public void CanBeEqualToThresholdLow()
        {
            var input = 60;
            var options = new ThresholdHighInput {
                SuppliedInput = input
            }.Validate(low: 60);

            options.ShouldBe(input);
        }
Beispiel #4
0
        public void MustBeMoreThanOrEqualToThresholdLow()
        {
            var ex = Assert.Throws <InputException>(() =>
            {
                var options = new ThresholdHighInput {
                    SuppliedInput = 59
                }.Validate(low: 60);
            });

            ex.Message.ShouldBe("Threshold high must be higher than or equal to threshold low. Current high: 59, low: 60.");
        }
Beispiel #5
0
        public void MustBeBetween0and100(int thresholdHigh)
        {
            var ex = Assert.Throws <InputException>(() =>
            {
                var options = new ThresholdHighInput {
                    SuppliedInput = thresholdHigh
                }.Validate(low: 0);
            });

            ex.Message.ShouldBe("Threshold high must be between 0 and 100.");
        }
Beispiel #6
0
        public void ShouldHaveHelpText()
        {
            var target = new ThresholdHighInput();

            target.HelpText.ShouldBe(@"Minimum good mutation score. Must be higher than or equal to threshold low. | default: '80' | allowed: 0 - 100");
        }