Example #1
0
        public void Should_not_match()
        {
            var values = new[] { 1, 2, 3, 4, 5 };

            var intParser = new AnyParser <int>();

            var parser = from x in intParser.Except(from y in intParser where y == 1 select y)
                         select x;

            var result = parser.ParseArray(values);

            Assert.IsFalse(result.HasValue);
        }
Example #2
0
        public void Should_match()
        {
            var values = new[] { 2, 3, 4, 5 };

            var intParser = new AnyParser <int>();

            var parser = from x in intParser.Except(from y in intParser where y == 1 select y)
                         select x;

            var result = parser.Execute(values);

            Assert.IsTrue(result.HasValue);
        }
Example #3
0
        public void Should_not_match()
        {
            var values = new[] {1, 2, 3, 4, 5};

            var intParser = new AnyParser<int>();

            var parser = from x in intParser.Except(from y in intParser where y == 1 select y)
                         select x;

            var result = parser.ParseArray(values);

            Assert.IsFalse(result.HasValue);
        }