コード例 #1
0
        public void ShouldFailToParseDifferentString()
        {
            var stringParser = BasicParsers.GetStringParser("whatever");
            var result       = stringParser.Parse("hatever") as Error <string>;

            Assert.AreEqual("Expected \"whatever\", got \"hatever\".", result?.Message);
        }
コード例 #2
0
        public void ShouldReturnCorrectRestToParse()
        {
            var stringParser = BasicParsers.GetStringParser("whatever");
            var result       = stringParser.Parse("whatever man");

            Assert.AreEqual(" man", result.Rest);
        }
コード例 #3
0
        public void ShouldParseSameString()
        {
            var stringParser = BasicParsers.GetStringParser("whatever");
            var result       = stringParser.Parse("whatever");

            Assert.AreNotEqual(typeof(Error <string>), result);
        }