CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

TestSuiteBuilderContextBase Class Reference

Context used when creating test suite in HelperMacros. More...

#include <TestSuiteBuilderContext.h>

Inheritance diagram for TestSuiteBuilderContextBase:

TestSuiteBuilderContext< Fixture > List of all members.

Public Member Functions

 TestSuiteBuilderContextBase (TestSuite &suite, const TestNamer &namer, TestFixtureFactory &factory)
 Constructs a new context.

virtual ~TestSuiteBuilderContextBase ()
void addTest (Test *test)
 Adds a test to the fixture suite.

std::string getFixtureName () const
 Returns the fixture name.

std::string getTestNameFor (const std::string &testMethodName) const
 Returns the name of the test for the specified method.

void addProperty (const std::string &key, const std::string &value)
 Adds property pair.

const std::string getStringProperty (const std::string &key) const
 Returns property value assigned to param key.


Protected Types

typedef std::pair< std::string,
std::string > 
Property
typedef CppUnitVector< PropertyProperties

Protected Member Functions

TestFixturemakeTestFixture () const

Protected Attributes

TestSuitem_suite
const TestNamerm_namer
TestFixtureFactorym_factory

Private Attributes

Properties m_properties

Detailed Description

Context used when creating test suite in HelperMacros.

Base class for all context used when creating test suite. The actual context type during test suite creation is TestSuiteBuilderContext.

See also:
CPPUNIT_TEST_SUITE, CPPUNIT_TEST_SUITE_ADD_TEST, CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS.


Member Typedef Documentation

typedef CppUnitVector<Property> TestSuiteBuilderContextBase::Properties [protected]
 

typedef std::pair<std::string,std::string> TestSuiteBuilderContextBase::Property [protected]
 


Constructor & Destructor Documentation

CPPUNIT_NS_BEGIN TestSuiteBuilderContextBase::TestSuiteBuilderContextBase TestSuite suite,
const TestNamer namer,
TestFixtureFactory factory
 

Constructs a new context.

You should not use this. The context is created in CPPUNIT_TEST_SUITE().

TestSuiteBuilderContextBase::~TestSuiteBuilderContextBase  )  [virtual]
 


Member Function Documentation

void TestSuiteBuilderContextBase::addProperty const std::string &  key,
const std::string &  value
 

Adds property pair.

Parameters:
key PropertyKey string to add.
value PropertyValue string to add.

void TestSuiteBuilderContextBase::addTest Test test  ) 
 

Adds a test to the fixture suite.

Parameters:
test Test to add to the fixture suite. Must not be NULL.

std::string TestSuiteBuilderContextBase::getFixtureName  )  const
 

Returns the fixture name.

Returns:
Fixture name. It is the name used to name the fixture suite.

const std::string TestSuiteBuilderContextBase::getStringProperty const std::string &  key  )  const
 

Returns property value assigned to param key.

Parameters:
key PropertyKey string.

std::string TestSuiteBuilderContextBase::getTestNameFor const std::string &  testMethodName  )  const
 

Returns the name of the test for the specified method.

Parameters:
testMethodName Name of the method that implements a test.
Returns:
A string that is the concatenation of the test fixture name (returned by getFixtureName()) andtestMethodName, separated using '::'. This provides a fairly unique name for a given test.

TestFixture * TestSuiteBuilderContextBase::makeTestFixture  )  const [protected]
 


Member Data Documentation

TestFixtureFactory& TestSuiteBuilderContextBase::m_factory [protected]
 

const TestNamer& TestSuiteBuilderContextBase::m_namer [protected]
 

Properties TestSuiteBuilderContextBase::m_properties [private]
 

TestSuite& TestSuiteBuilderContextBase::m_suite [protected]
 


The documentation for this class was generated from the following files:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers