public void IntegerRangeResult_RangeResultMaximumShouldBeCorrect() { // Arrange IntegerRangeArgument argument = new IntegerRangeArgument(); IStringReader reader = new StringReader("..10"); // Act argument.Parse(reader, out Range <int> result); // Assert Assert.AreEqual(result.Maximum, 10); }
public void IntegerRangeArgument_ParseShouldSucceed_WithLoopable() { // Arrange IntegerRangeArgument argument = new IntegerRangeArgument(true); IStringReader reader = new StringReader("10..-10"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsTrue(readResults.Successful); }
public void IntegerRangeArgument_ParseShouldFail_BecauseEmpty() { // Arrange IntegerRangeArgument argument = new IntegerRangeArgument(); IStringReader reader = new StringReader(".."); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsFalse(readResults.Successful); }
public void IntegerRangeArgument_ParseShouldSucceed_WithSingleNumber() { // Arrange IntegerRangeArgument argument = new IntegerRangeArgument(); IStringReader reader = new StringReader("1"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsTrue(readResults.Successful); }