RB Dynamic Refactoring Tests
Last published: March 8, 2010 by 'nross'
Defines 6 Classes
Extends 7 Classes
This package has integrated model-layer and UI-layer tests for dynamic renaming. By overriding #renameAround: to set values in the UI, and #tearDown to close that UI, the same tests serve to exercise both the model and the UI. When driving the model, they populate the parameters of model-layer methods directly. When driving the UI, the same values are assigned to widgets and the appropriate UI buttons then invoked. This is an effective pattern for writing model-layer tests that can then be extended to UI layer tests (or vice versa if that happens to be the way you build your application).
UI tests -> DynamicRenameUI
model tests -> DynamicRename
Because this was my first use of this pattern, the overrides only use the UI to input the values and drive the operation. Results are extracted for checking from the model-layer objects in both cases. I should make the UI tests get the results from the UI widgets, so testing the whole UI cycle.
Build a suite of all this package's concrete tests via
(TestSuite named: 'RBDynamicRefactoringTests') addTests:
(((Store.Registry packageNamed: 'RBDynamicRefactoringTests') allDefinedClasses
select: [:each | (each isKindOf: TestCase class) and: [each isAbstract not]])
collect: [:each | each buildSuite])