示例#1
0
        public void SucceedsWithNoItems()
        {
            var parser = new UnorderedParser <string>(UnorderedParsingMode.AnySubset, a, b, c, d);

            parser.Parses(Tokenize(""))
            .ParsedValue
            .ShouldBe(new string[4]);
        }
示例#2
0
        public void SucceedsWithNoKnownItemsSeparated()
        {
            var parser = new UnorderedParser <string>(separator, UnorderedParsingMode.AnySubset, a, b, c, d);

            parser.Parses(Tokenize("X"), false)
            .ParsedValue
            .ShouldBe(new string[4]);
        }
示例#3
0
        public void ParsesNonemptySubsetsOfItemsSeparated()
        {
            var parser = new UnorderedParser <string>(separator, UnorderedParsingMode.NonemptySubset, a, b, c);

            foreach (var input in
                     GetPermutationsSeparated("abc")
                     .Concat(GetPermutationsSeparated("ab"))
                     .Concat(GetPermutationsSeparated("bc"))
                     .Concat(GetPermutationsSeparated("ac"))
                     .Concat(GetPermutationsSeparated("a"))
                     .Concat(GetPermutationsSeparated("b"))
                     .Concat(GetPermutationsSeparated("c")))
            {
                parser.Parses(Tokenize(input));
            }
        }