Added an example demonstrating one constraint for multiple arguments.

This commit is contained in:
Mathieu Champlon 2015-04-02 06:52:58 +02:00
parent 1a4a919f81
commit 1f1e143b06
2 changed files with 25 additions and 0 deletions

View file

@ -716,6 +716,27 @@ BOOST_AUTO_TEST_CASE( demonstrates_combining_constraints )
//]
}
namespace constraints_example_9
{
//[ constraints_example_9
MOCK_CLASS( mock_class )
{
MOCK_METHOD( method, 2, void( const std::string&, std::size_t ) )
};
bool custom_constraint( const std::string& actual_1, std::size_t actual_2 )
{
return actual_1.size() <= actual_2;
}
BOOST_AUTO_TEST_CASE( demonstrates_one_constraint_for_all_arguments )
{
mock_class c;
MOCK_EXPECT( c.method ).with( &custom_constraint );
}
//]
}
namespace sequence_example_1
{
//[ sequence_example_1