Fixture definition (C++ only)
Table of Contents
The WinUnit API supports two kinds of tests -- standalone tests (definded with BEGIN_TEST and END_TEST), and fixtures (defined with FIXTURE and BEGIN_TESTF/END_TESTF).
#include <winunit.h> // // 'Standalone' tests. // BEGIN_TEST( ExampleStandaloneTest ) { WIN_ASSERT_EQUAL( 1, 1 ); WIN_ASSERT_STRING_EQUAL( "foo bar", "foo bar" ); } END_TEST // // Fixture. // FIXTURE( TestFixture ); SETUP( TestFixture ) { WIN_TRACE( L"Setting up" ); } TEARDOWN( TestFixture ) { WIN_TRACE( L"Tearing down" ); } BEGIN_TESTF( Test, TestFixture ) { WIN_ASSERT_EQUAL( 1, 1 ); WIN_ASSERT_STRING_EQUAL( "foo bar", "foo bar" ); } END_TESTF