IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Internal.TestFilter Class Referenceabstract

Interface to be implemented by filters applied to tests. The filter applies when running the test, after it has been loaded, since this is the only time an ITest exists. More...

+ Inheritance diagram for NUnit.Framework.Internal.TestFilter:
+ Collaboration diagram for NUnit.Framework.Internal.TestFilter:

Classes

class  EmptyFilter
 Nested class provides an empty filter - one that always returns true when called. It never matches explicitly. More...
 

Public Member Functions

virtual bool Pass (ITest test)
 Determine if a particular test passes the filter criteria. The default implementation checks the test itself, its parents and any descendants. More...
 
virtual bool IsExplicitMatch (ITest test)
 Determine if a test matches the filter expicitly. That is, it must be a direct match of the test itself or one of it's children. More...
 
abstract bool Match (ITest test)
 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. More...
 
bool MatchParent (ITest test)
 Determine whether any ancestor of the test matches the filter criteria More...
 
TNode ToXml (bool recursive)
 Adds an XML node More...
 
abstract TNode AddToXml (TNode parentNode, bool recursive)
 Adds an XML node More...
 

Static Public Member Functions

static TestFilter FromXml (string xmlText)
 Create a TestFilter instance from an xml representation. More...
 
static TestFilter FromXml (TNode node)
 Create a TestFilter from it's TNode representation More...
 

Static Public Attributes

static readonly TestFilter Empty = new EmptyFilter()
 Unique Empty filter. More...
 

Protected Member Functions

virtual bool MatchDescendant (ITest test)
 Determine whether any descendant of the test matches the filter criteria. More...
 

Properties

bool IsEmpty [get]
 Indicates whether this is the EmptyFilter More...
 
bool TopLevel [get, set]
 Indicates whether this is a top-level filter, not contained in any other filter. More...
 

Static Private Attributes

static readonly char[] COMMA = new char[] { ',' }
 

Detailed Description

Interface to be implemented by filters applied to tests. The filter applies when running the test, after it has been loaded, since this is the only time an ITest exists.

Member Function Documentation

virtual bool NUnit.Framework.Internal.TestFilter.Pass ( ITest  test)
inlinevirtual

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.

Parameters
testThe test to which the filter is applied
Returns
True if the test passes the filter, otherwise false

Implements NUnit.Framework.Interfaces.ITestFilter.

Reimplemented in NUnit.Framework.Internal.TestFilter.EmptyFilter, NUnit.Framework.Internal.Filters.NotFilter, NUnit.Framework.Internal.Filters.AndFilter, and NUnit.Framework.Internal.Filters.OrFilter.

Referenced by NUnit.Framework.Internal.Filters.CategoryFilterTests.PassTest(), NUnit.Framework.Internal.Filters.IdFilterTests.PassTest(), NUnit.Framework.Internal.Filters.PropertyFilterTests.PassTest(), NUnit.Framework.Internal.Filters.MethodNameFilterTests.PassTest(), NUnit.Framework.Internal.Filters.ClassNameFilterTests.PassTest(), NUnit.Framework.Internal.Filters.FullNameFilterTests.PassTest(), and NUnit.Framework.Internal.Filters.TestNameFilterTests.PassTest().

abstract bool NUnit.Framework.Internal.TestFilter.Match ( ITest  test)
pure virtual

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.

Parameters
testThe test to which the filter is applied
Returns
True if the filter matches the any parent of the test

Implemented in NUnit.Framework.Internal.TestFilter.EmptyFilter, NUnit.Framework.Internal.Filters.NotFilter, NUnit.Framework.Internal.Filters.AndFilter, NUnit.Framework.Internal.Filters.OrFilter, NUnit.Framework.Internal.Filters.PropertyFilter, NUnit.Framework.Internal.Filters.CategoryFilter, NUnit.Framework.Internal.Filters.IdFilter, NUnit.Framework.Internal.Filters.ClassNameFilter, NUnit.Framework.Internal.Filters.FullNameFilter, NUnit.Framework.Internal.Filters.MethodNameFilter, and NUnit.Framework.Internal.Filters.TestNameFilter.

Referenced by NUnit.Framework.Internal.Filters.AndFilterTests.BuildFromXml(), NUnit.Framework.Internal.Filters.OrFilterTests.BuildFromXml(), NUnit.Framework.Internal.Filters.NotFilterTests.BuildFromXml(), NUnit.Framework.Internal.Filters.AndFilterTests.BuildFromXml_TopLevelDefaultsToAnd(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.BuildMethodNameFilter_FromXml_Regex(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.CategoryFilter_FromXml(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.CategoryFilter_FromXml_Regex(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.ClassNameFilter_FromXml(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.ClassNameFilter_FromXml_Regex(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.FullNameFilter_FromXml(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.FullNameFilter_FromXml_Regex(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.IdFilter_FromXml(), NUnit.Framework.Internal.Filters.OrFilter.Match(), NUnit.Framework.Internal.Filters.AndFilter.Match(), NUnit.Framework.Internal.Filters.IdFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.CategoryFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.PropertyFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.ClassNameFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.MethodNameFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.TestNameFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.FullNameFilterTests.MatchTest(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.MethodNameFilter_FromXml(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.PropertyFilter_FromXml(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.PropertyFilter_FromXml_Regex(), NUnit.Framework.Internal.Filters.TestFilterXmlTests.TestNameFilter_FromXml(), and NUnit.Framework.Internal.Filters.TestFilterXmlTests.TestNameFilter_FromXml_Regex().

bool NUnit.Framework.Internal.TestFilter.MatchParent ( ITest  test)
inline

Determine whether any ancestor of the test matches the filter criteria

Parameters
testThe test to which the filter is applied
Returns
True if the filter matches the an ancestor of the test

References NUnit.Framework.Interfaces.ITest.Parent.

virtual bool NUnit.Framework.Internal.TestFilter.MatchDescendant ( ITest  test)
inlineprotectedvirtual

Determine whether any descendant of the test matches the filter criteria.

Parameters
testThe test to be matched
Returns
True if at least one descendant matches the filter criteria

References NUnit.Framework.Interfaces.ITest.Tests.

static TestFilter NUnit.Framework.Internal.TestFilter.FromXml ( string  xmlText)
inlinestatic
abstract TNode NUnit.Framework.Internal.TestFilter.AddToXml ( TNode  parentNode,
bool  recursive 
)
pure virtual

Member Data Documentation

readonly TestFilter NUnit.Framework.Internal.TestFilter.Empty = new EmptyFilter()
static

Unique Empty filter.

readonly char [] NUnit.Framework.Internal.TestFilter.COMMA = new char[] { ',' }
staticprivate

Property Documentation

bool NUnit.Framework.Internal.TestFilter.TopLevel
getset

Indicates whether this is a top-level filter, not contained in any other filter.

Referenced by NUnit.Framework.Internal.TestFilter.FromXml().


The documentation for this class was generated from the following file: