Match() public abstract method

Determine whether the test itself matches the filter criteria, without examining either parents or descendants. This is overridden by each different type of filter to perform the necessary tests.
public abstract Match ( ITest test ) : bool
test ITest The test to which the filter is applied
return bool
Example #1
0
        public void CategoryFilter_BuildFromXml_MultipleCategories()
        {
            TestFilter filter = TestFilter.FromXml(
                "<filter><cat>A,B,C,Dummy,Another,X,Y,Z</cat></filter>");

            Assert.That(filter, Is.TypeOf <CategoryFilter>());
            Assert.That(filter.Match(dummyFixture));
            Assert.That(filter.Match(anotherFixture));
            Assert.False(filter.Match(yetAnotherFixture));
        }
Example #2
0
        public void IdFilter_BuildFromXml_MultipleIds()
        {
            TestFilter filter = TestFilter.FromXml(
                string.Format("<filter><id>{0},{1}</id></filter>", dummyFixture.Id, anotherFixture.Id));

            Assert.That(filter, Is.TypeOf <IdFilter>());
            Assert.That(filter.Match(dummyFixture));
            Assert.That(filter.Match(anotherFixture));
            Assert.False(filter.Match(yetAnotherFixture));
        }
Example #3
0
        public void SimpleNameFilter_BuildFromXml_MultipleTests()
        {
            TestFilter filter = TestFilter.FromXml(
                "<filter><tests><test>NUnit.Framework.Internal.TestFilterTests+DummyFixture</test><test>NUnit.Framework.Internal.TestFilterTests+AnotherFixture</test></tests></filter>");

            Assert.That(filter, Is.TypeOf <SimpleNameFilter>());
            Assert.That(filter.Match(dummyFixture));
            Assert.That(filter.Match(anotherFixture));
            Assert.False(filter.Match(yetAnotherFixture));
        }