Exemple #1
0
        public void GetInt_WhenRightBorderSpeficied_ReturnsNumberBiggerThanRightBorder()
        {
            var generator = new RandomValueGenerator();

            var result = generator.GetInt(1, 2);

            result.Should().BeLessOrEqualTo(2);
        }
Exemple #2
0
        public void GetInt_WhenBordersAreTheSame_ReturnsBorder()
        {
            var generator = new RandomValueGenerator();

            var result = generator.GetInt(6, 6);

            result.Should().Be(6);
        }
Exemple #3
0
        public void GetInt_Run10Times_OutputToConsole()
        {
            var generator = new RandomValueGenerator();

            for (var i = 0; i < 10; i++)
            {
                var result = generator.GetInt(1, 9999);

                _testOutputHelper.WriteLine($"RandomNumber: {result}");
            }
        }
Exemple #4
0
        public void GetInt_WhenBordersInconsistent_ThrowsArgumentOutOfRangeException()
        {
            var generator = new RandomValueGenerator();

            Assert.Throws <ArgumentOutOfRangeException>(() => generator.GetInt(5, 1));
        }