public void GivenAnyWhenPositiveIntegerThenPositiveIntegerReturned() { var positiveInt = AnyVal.PositiveInt32(); positiveInt.Should().BeGreaterOrEqualTo(0); Console.WriteLine(positiveInt); }
public void GivenNegativeFirstIntegerAndPositiveSecondIntegerWhenPositiveIntegerThenValueReturned() { const int startValue = -100; const int endValue = 100; var positiveRange = AnyVal.PositiveInt32(startValue, endValue); positiveRange.Should().Be(endValue); Console.WriteLine(positiveRange); }
public void GivenAnyWhenPositiveIntegerMaxThenPositiveIntegerReturned() { const int maxValue = 50; var positiveInt = AnyVal.PositiveInt32(maxValue); positiveInt.Should().BeLessOrEqualTo(maxValue); positiveInt.Should().BeGreaterOrEqualTo(0); Console.WriteLine(positiveInt); }
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); }
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); }
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); }