Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }