mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Remove user(doc) visible change to zero_plus_zero_is_zero_with_action
Tests via Fixture::teardown that the assertion is fulfilled
This commit is contained in:
parent
40a4b3ceb4
commit
728dfd06eb
1 changed files with 10 additions and 3 deletions
|
|
@ -149,6 +149,7 @@ BOOST_AUTO_TEST_CASE( add_several_numbers_in_sequences )
|
||||||
}
|
}
|
||||||
//]
|
//]
|
||||||
}
|
}
|
||||||
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
namespace action
|
namespace action
|
||||||
{
|
{
|
||||||
|
|
@ -174,7 +175,7 @@ public:
|
||||||
void add( int a, int b ){ v.display(a + b); }
|
void add( int a, int b ){ v.display(a + b); }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CatchFailureFixture
|
struct CatchFailureFixture: Fixture
|
||||||
{
|
{
|
||||||
static bool aborted;
|
static bool aborted;
|
||||||
static std::string fail_msg;
|
static std::string fail_msg;
|
||||||
|
|
@ -200,14 +201,20 @@ struct CatchFailureFixture
|
||||||
bool CatchFailureFixture::aborted = false;
|
bool CatchFailureFixture::aborted = false;
|
||||||
std::string CatchFailureFixture::fail_msg;
|
std::string CatchFailureFixture::fail_msg;
|
||||||
|
|
||||||
|
struct AssertMissingAction: CatchFailureFixture{
|
||||||
|
void teardown(){
|
||||||
|
assert_failure("missing action");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
BOOST_FIXTURE_TEST_SUITE( MissingReturnActionSuite, AssertMissingAction)
|
||||||
//[ action_test
|
//[ action_test
|
||||||
BOOST_FIXTURE_TEST_CASE( zero_plus_zero_is_zero_with_action, CatchFailureFixture )
|
BOOST_AUTO_TEST_CASE( zero_plus_zero_is_zero_with_action )
|
||||||
{
|
{
|
||||||
mock_view v;
|
mock_view v;
|
||||||
calculator c( v );
|
calculator c( v );
|
||||||
MOCK_EXPECT( v.display ).once().with( 0 ); // missing returns( true )
|
MOCK_EXPECT( v.display ).once().with( 0 ); // missing returns( true )
|
||||||
c.add( 0, 0 );
|
c.add( 0, 0 );
|
||||||
assert_failure("missing action");
|
|
||||||
}
|
}
|
||||||
//]
|
//]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue