Match() public method

Check whether the filter matches a test
public Match ( ITest test ) : bool
test ITest The test to be matched
return bool
コード例 #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));
        }
コード例 #2
0
ファイル: NotFilterTests.cs プロジェクト: rojac07/nunit
        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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #5
0
ファイル: TestFilterTests.cs プロジェクト: JohanLarsson/nunit
        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));
        }
コード例 #6
0
ファイル: TestFilterTests.cs プロジェクト: jhsiegel/nunit
        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));
        }