示例#1
0
        public void CreateRandomNumber_GivenMinimumAndMaximumValues_ShouldGenerateValueBetweenGivenValues(int minimumValue, int maximumValue)
        {
            //---------------Set up test pack-------------------
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var randomNumber = RandomValueGenerator.CreateRandomNumber(minimumValue, maximumValue);

            //---------------Test Result -----------------------
            randomNumber.Should().BeGreaterOrEqualTo(minimumValue);
            randomNumber.Should().BeLessOrEqualTo(maximumValue);
        }
示例#2
0
        public void CreateRandomNumber_GivenLargeLongAndMinimumAndMaximumValues_ShouldGenerateValueBetweenGivenValues()
        {
            //---------------Set up test pack-------------------
            var minimumValue = new DateTime(1990, 1, 1).Ticks;
            var maximumValue = new DateTime(2020, 12, 31).Ticks;
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var randomNumber = RandomValueGenerator.CreateRandomNumber(minimumValue, maximumValue);

            //---------------Test Result -----------------------
            randomNumber.Should().BePositive();
            randomNumber.Should().BeGreaterOrEqualTo(minimumValue);
            randomNumber.Should().BeLessOrEqualTo(maximumValue);
        }