Dummy HandingPattern implementation for unit tests

This commit is contained in:
Fischlurch 2009-10-01 01:51:47 +02:00
parent bb45ad67d8
commit effbb49afb

View file

@ -151,6 +151,37 @@ namespace control {
/**
* Handling Pattern: invoke command directly and without any integration
* with other facilities. This pattern is intended to be used for unit tests.
*/
class InvokeDirectly
: public HandlingPattern
{
void
perform (CommandImpl& command) const
{
REQUIRE (command.canExec());
command.invokeCapture();
command.invokeOperation();
}
void
revert(CommandImpl& command) const
{
REQUIRE (command.canUndo());
command.invokeUndo();
}
bool
isValid() const
{
return true;
}
};