public void LongArgument_ParseShouldFail_BecauseNumberIsTooLow() { // Arrange LongArgument argument = new LongArgument(minimum: 0L); IStringReader reader = new StringReader("-10"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsFalse(readResults.Successful); }
public void LongResult_ShouldHaveCorrectValue() { // Arrange LongArgument argument = new LongArgument(); IStringReader reader = new StringReader("123"); // Act argument.Parse(reader, out long result); // Assert Assert.AreEqual(result, 123L); }
public void LongArgument_ParseShouldFail_BecauseInvalidLong() { // Arrange LongArgument argument = new LongArgument(); IStringReader reader = new StringReader("1.5"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsFalse(readResults.Successful); }
public void LongArgument_ParseShouldSucceed() { // Arrange LongArgument argument = new LongArgument(); IStringReader reader = new StringReader("123"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsTrue(readResults.Successful); }