Match() public method

Check whether the filter matches a test
public Match ( ITest test ) : bool
test ITest The test to be matched
return bool
Esempio n. 1
0
        public void NotAndNotFilterTests()
        {
            var filter = new NotFilter(
                new AndFilter(
                    new NotFilter(
                        new CategoryFilter("Dummy")),
                    new MethodNameFilter("Test1")));

            Assert.That(filter.Pass(_topLevelSuite));
            Assert.That(filter.Match(_topLevelSuite));

            Assert.That(filter.Pass(_fixtureWithMultipleTests));
            Assert.That(filter.Match(_fixtureWithMultipleTests));

            var test1 = _fixtureWithMultipleTests.Tests[0];

            Assert.False(filter.Pass(test1));
            Assert.False(filter.Match(test1));

            var test2 = _fixtureWithMultipleTests.Tests[1];

            Assert.That(filter.Pass(test2));
            Assert.False(filter.IsExplicitMatch(test2));
            Assert.That(filter.Match(test2));
        }
Esempio n. 2
0
        public void MatchTest()
        {
            var filter = new NotFilter(new CategoryFilter("Dummy"));

            Assert.True(filter.Match(_topLevelSuite));
            Assert.False(filter.Match(_dummyFixture));
            Assert.True(filter.Match(_dummyFixture.Tests[0]));

            Assert.True(filter.Match(_anotherFixture));
        }
Esempio n. 3
0
        public void MatchTest()
        {
            var filter = new NotFilter(new CategoryFilter("Dummy"));

            Assert.True(filter.Match(_topLevelSuite));
            Assert.False(filter.Match(_dummyFixture));
            Assert.True(filter.Match(_dummyFixture.Tests[0]));

            Assert.True(filter.Match(_anotherFixture));
        }
Esempio n. 4
0
        public void TestNestedNotCategoryFilters()
        {
            var filter = new NotFilter(new CategoryFilter("NotDummy"));

            Assert.That(filter.Match(_dummyFixture));
            Assert.False(filter.IsExplicitMatch(_dummyFixture));

            Assert.That(filter.Match(_anotherFixture));
            Assert.False(filter.IsExplicitMatch(_anotherFixture));

            Assert.That(filter.Match(_yetAnotherFixture));
            Assert.False(filter.IsExplicitMatch(_yetAnotherFixture));

            Assert.That(filter.Match(_explicitFixture));
            Assert.False(filter.IsExplicitMatch(_explicitFixture));
        }
Esempio n. 5
0
        public void NotFilter_Constructor()
        {
            var filter = new NotFilter(new CategoryFilter("Dummy"));

            Assert.False(filter.IsEmpty);
            Assert.False(filter.Match(dummyFixture));
            Assert.True(filter.Match(anotherFixture));
        }
Esempio n. 6
0
        public void NotFilter_Constructor_TopLevel()
        {
            var filter = new NotFilter(new CategoryFilter("Dummy"));
            filter.TopLevel = true;

            Assert.False(filter.IsEmpty);
            Assert.False(filter.Match(dummyFixture));
            Assert.False(filter.Match(dummyFixture.Tests[0]));
            Assert.True(filter.Match(anotherFixture));
        }