Exemple #1
0
        public void TryConvertToTokenStream_ReturnsFailureResult_WhenInputStreamContainsInvalidCharacter()
        {
            _parserFactory.TryGetTokenParser(Arg.Any <string>(), out _).Returns(false);
            _input.IsEmpty().Returns(false);
            var lexer = new Lexer(_parserFactory);

            var result = lexer.TryConvertToTokenStream(_input, out _);

            Assert.IsFalse(result.IsSuccess);
            _input.Received(1).IsEmpty();
            _parserFactory.Received(1).TryGetTokenParser(Arg.Any <string>(), out _);
        }