Exemple #1
0
        public void RandomNumberShouldEqualIfMinAndMaxAreSame()
        {
            IRandomDataService randomDataService = new RandomDataService();

            int val          = 7;
            int randomNumber = randomDataService.RandomNumber(val, val);

            Assert.Equal(val, randomNumber);
        }
Exemple #2
0
        public void RandomNumberShouldBeWithinLimits()
        {
            IRandomDataService randomDataService = new RandomDataService();

            int min          = 0;
            int max          = 5;
            int randomNumber = randomDataService.RandomNumber(min, max);

            Assert.InRange(randomNumber, min, max);
        }
Exemple #3
0
        public void RandomNumberShouldThrowIfMaxIsSmallerThanMin()
        {
            IRandomDataService randomDataService = new RandomDataService();

            Assert.Throws <ArgumentOutOfRangeException>("max", () => randomDataService.RandomNumber(max: -1));
        }