public void DoubleArgument_ParseShouldFail_BecauseNumberIsTooLow() { // Arrange DoubleArgument argument = new DoubleArgument(minimum: 0.0d); IStringReader reader = new StringReader("-10"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsFalse(readResults.Successful); }
public void DoubleResult_ShouldHaveCorrectValue() { // Arrange DoubleArgument argument = new DoubleArgument(); IStringReader reader = new StringReader("123"); // Act argument.Parse(reader, out double result); // Assert Assert.AreEqual(result, 123.0d); }
public void DoubleArgument_ParseShouldFail_BecauseInvalidDouble() { // Arrange DoubleArgument argument = new DoubleArgument(); IStringReader reader = new StringReader("1..5"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsFalse(readResults.Successful); }
public void DoubleArgument_ParseShouldSucceed() { // Arrange DoubleArgument argument = new DoubleArgument(); IStringReader reader = new StringReader("123"); // Act ReadResults readResults = argument.Parse(reader, out _); // Assert Assert.IsTrue(readResults.Successful); }