Ejemplo n.º 1
0
        public void groupFilters()
        {
            String actual;

            // Verify 0 works
            using (Pnyx p = new Pnyx())
            {
                p.readString(EARTH);
                p.and(pn => { });
                actual = p.processToString();
            }

            Assert.Equal(EARTH, actual);

            // Verify 1 works
            using (Pnyx p = new Pnyx())
            {
                p.readString(PLANETS_GODS);
                p.and(pn => pn.grep("titan", caseSensitive: false));
                actual = p.processToString();
            }

            Assert.Equal(PLANETS_GODS_TITANS, actual);

            // Verify X works
            using (Pnyx p = new Pnyx())
            {
                p.readString(PLANETS_GODS);
                p.and(pn =>
                {
                    pn.grep("ti");
                    pn.grep("sky");
                });
                actual = p.processToString();
            }

            Assert.Equal(@"Cronus,Saturn,""Titan sky god, supreme ruler of the titans""
", actual);
        }