Ejemplo n.º 1
0
        public void GivenAnyWhenPositiveIntegerThenPositiveIntegerReturned()
        {
            var positiveInt = AnyVal.PositiveInt32();

            positiveInt.Should().BeGreaterOrEqualTo(0);
            Console.WriteLine(positiveInt);
        }
Ejemplo n.º 2
0
        public void GivenNegativeFirstIntegerAndPositiveSecondIntegerWhenPositiveIntegerThenValueReturned()
        {
            const int startValue    = -100;
            const int endValue      = 100;
            var       positiveRange = AnyVal.PositiveInt32(startValue, endValue);

            positiveRange.Should().Be(endValue);
            Console.WriteLine(positiveRange);
        }
Ejemplo n.º 3
0
        public void GivenAnyWhenPositiveIntegerMaxThenPositiveIntegerReturned()
        {
            const int maxValue    = 50;
            var       positiveInt = AnyVal.PositiveInt32(maxValue);

            positiveInt.Should().BeLessOrEqualTo(maxValue);
            positiveInt.Should().BeGreaterOrEqualTo(0);
            Console.WriteLine(positiveInt);
        }
Ejemplo n.º 4
0
        public void GivenAnyWhenAlphanumericWithSizeThenAlphanumericReturned()
        {
            var size = AnyVal.PositiveInt32(32);
            var alphaNumericReturned = AnyVal.Alphanumeric(size);

            alphaNumericReturned.Should().MatchRegex("^[a-zA-Z0-9]*");
            alphaNumericReturned.Length.Should().Be(size);
            Console.WriteLine(alphaNumericReturned);
        }
Ejemplo n.º 5
0
        public void GivenNegativeFirstIntegerAndNegativeSecondIntegerWhenPositiveIntegerThenValueReturned()
        {
            const int startValue    = -100;
            const int endValue      = -200;
            var       positiveValue = AnyVal.PositiveInt32(startValue, endValue);

            positiveValue.Should().BeGreaterOrEqualTo(Math.Abs(startValue));
            positiveValue.Should().BeLessOrEqualTo(Math.Abs(endValue));
            Console.WriteLine(positiveValue);
        }
Ejemplo n.º 6
0
        public void GivenAnyWhenNegativeRangeThenPositiveInRangeReturned()
        {
            const int startValue    = 1024;
            const int endValue      = -2048;
            var       positiveRange = AnyVal.PositiveInt32(startValue, endValue);

            positiveRange.Should().BeGreaterOrEqualTo(startValue);
            positiveRange.Should().BeLessOrEqualTo(Math.Abs(endValue));
            Console.WriteLine(positiveRange);
        }