MoSync 3.3
Testify::TestCase Class Reference

A test case. This class should be overloaded to handle test cases. More...

#include <testify/testcase.hpp>

Inheritance diagram for Testify::TestCase:
Testify::Test

List of all members.

Public Member Functions

 TestCase (const char *n="no_name_testcase")
virtual ~TestCase (void)
virtual void caseSetUp (void)
virtual void caseTearDown (void)
virtual void testSetUp (void)
virtual void testTearDown (void)
void addTest (Functor *f, const char *n="no_name_test_method")
virtual void run (void)

Static Public Member Functions

static Testcreate (Functor *f, const char *n="no_name_function")

Detailed Description

A test case. This class should be overloaded to handle test cases.

It has global set up and tear down, as well as a set up and tear down for each test. Using them are optional, to use them one has to overload

To add a test method, one invokes the addTest(...) method from the constructor once for each test. It's arguments are

  • A functor which wraps the test method
  • An optional name for the test method

Constructor & Destructor Documentation

Testify::TestCase::TestCase ( const char *  n = "no_name_testcase")

Constructor

Parameters:
nTest case name, default value is 'no_name_case'
virtual Testify::TestCase::~TestCase ( void  ) [virtual]

Destructor


Member Function Documentation

virtual void Testify::TestCase::caseSetUp ( void  ) [virtual]

Called once before any test has run Note: Overload if you need a custom version

virtual void Testify::TestCase::caseTearDown ( void  ) [virtual]

Called once after all tests have run Note: Overload if you need a custom version

virtual void Testify::TestCase::testSetUp ( void  ) [virtual]

Called once before every test Note: Overload if you need a custom version

virtual void Testify::TestCase::testTearDown ( void  ) [virtual]

Called once after each test Note: Overload if you need a custom version

void Testify::TestCase::addTest ( Functor f,
const char *  n = "no_name_test_method" 
)

Adds a test case

Parameters:
fPointer to functor which contains the test
nName of test, default value is 'no_name_test_method'
virtual void Testify::TestCase::run ( void  ) [virtual]

Runs tests

Implements Testify::Test.

static Test* Testify::Test::create ( Functor f,
const char *  n = "no_name_function" 
) [static, inherited]

Creates a test function

Parameters:
fPointer to a functor which contains the test
nTest name, default value is 'no_name_function'
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines