Пример #1
0
        public void VerboseProvided_VerboseIsSet(string args)
        {
            var randomizer = new RandomizerInTest();
            var parameters = new Parameters(randomizer, args);

            Assert.That(parameters.IsVerboseEnabled, Is.EqualTo(true));
        }
Пример #2
0
        public void TargetProvided_TargetIsSet(string args)
        {
            var randomizer = new RandomizerInTest(target: 15);
            var parameters = new Parameters(randomizer, args);

            Assert.That(parameters.Target, Is.EqualTo(15));
        }
Пример #3
0
        public void AllProvided_AllIsSet(string args)
        {
            var randomizer = new RandomizerInTest();
            var parameters = new Parameters(randomizer, args);

            Assert.That(parameters.ShowAllResults, Is.EqualTo(true));
        }
Пример #4
0
        public void NoParameters_AllValuesHaveDefaultValues()
        {
            var randomizer = new RandomizerInTest();
            var parameters = new Parameters(randomizer, "");

            Assert.That(parameters.IsVerboseEnabled, Is.EqualTo(false));
            Assert.That(parameters.Target, Is.EqualTo(0));
            Assert.That(parameters.Numbers.Count, Is.EqualTo(0));
        }
Пример #5
0
        public void NumbersProvided_NumbersIsSet(string args)
        {
            var randomizer = new RandomizerInTest(numbers: new List <int> {
                1, 2, 3
            });
            var parameters   = new Parameters(randomizer, args);
            var numberString = string.Join(",", parameters.Numbers.Select(o => o.ToString()));

            Assert.That(numberString, Is.EqualTo("1,2,3"));
        }
Пример #6
0
        public void AllParameters_AllValuesAreSet()
        {
            var randomizer = new RandomizerInTest(target: 15, numbers: new List <int> {
                1, 2, 3, 4, 5
            });
            var parameters = new Parameters(randomizer, "--verbose --target 15 --numbers 1,2,3,4,5");

            Assert.That(parameters.IsVerboseEnabled, Is.EqualTo(true));
            Assert.That(parameters.Target, Is.EqualTo(15));
            Assert.That(parameters.Numbers.Count, Is.EqualTo(5));
        }