Test Design - GerdHirsch/Cpp-UndoRedoFramework GitHub Wiki

Test Design

The objectiv of the test design is to provide all test to all implementations without the need to change the library. The Design is based on the Template Method and the Factory Method Pattern of the GoF.

There are tests provided for each abstraction (UndoRedoStack, UndoRedoManager and CompositeCommand) in the framework in project Test/UndoRedoTestCute which is a static library. Common Test Base is class UndoRedoTest. Because the implementation of UndoRedoManager uses exlusiv either delegation or virtual inheritance, the tests are implemented as C++ templates, so they are able to handle this.

The project UndoRedoDefaultTest specifies the default implementations of the framework as SUT to the tests.

Customizing

As a starting point to customize the implementations in a C++ Workshop, the projects UndoRedoCustomizedTest and UndoRedoCustomized are provided. You must link UndoRedoCustomizedTest with the static library of UndoRedoTestCute for the purpose of testing your CompositeCommand implementation. Write your own implementations in UndoRedoCustomized and spezify them as SUT in UndoRedoCustomizedTest as it is prepared for UndoRedoStack.

Test classes