Pass() public method

Determine if a particular test passes the filter criteria. The default implementation checks the test itself, its parents and any descendants. Derived classes may override this method or any of the Match methods to change the behavior of the filter.
public Pass ( ITest test ) : bool
test ITest The test to which the filter is applied
return bool
Exemplo 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));
        }
Exemplo n.º 2
0
        public void PassTest()
        {
            var filter = new NotFilter(new CategoryFilter("Dummy"));

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

            Assert.True(filter.Pass(_anotherFixture));
            Assert.True(filter.Pass(_anotherFixture.Tests[0]));
        }
Exemplo n.º 3
0
        public void PassTest()
        {
            var filter = new NotFilter(new CategoryFilter("Dummy"));

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

            Assert.True(filter.Pass(_anotherFixture));
            Assert.True(filter.Pass(_anotherFixture.Tests[0]));
        }