Exemplo n.º 1
0
        public void Provide_A_Generic_Version()
        {
            // arrange
            var positional = new Positional <string>(new Parser("a"), (o, strings) => { });
            var info       = new IterationInfo("a b c".Split(' '));

            // act
            var res = positional.CanConsume("", info);

            // assert
            res.NumConsumed.Should().Be(3);
        }
Exemplo n.º 2
0
        public void Indicate_It_Cannot_Consume_If_It_Has_Already_Consumed()
        {
            // arrange
            var positional = new Positional(new Parser("a"), (o, strings) => { })
            {
                HasBeenConsumed = true
            };
            var info = new IterationInfo("a b c".Split(' '));

            // act
            var res = positional.CanConsume("", info);

            // assert
            res.NumConsumed.Should().Be(0);
        }