Details
-
Improvement
-
Resolution: Fixed
-
Major
-
1.5
-
None
Description
The IoC Testing framework seems to have been designed before "listener boiling" was a commonplace feature of the IoC framework itself. As a result, it has a peculiar syntax for supplying varying arguments to "event" fixtures, involving the "listenerMaker" and "makerArgs" values. For example, from the metadata component's tests, we have the following:
gpii.tests.bindDialog.makeEventChecker = function (eventName) {
return function ()
;
};
with a fixture entry
{
listenerMaker: "gpii.tests.bindDialog.makeEventChecker",
makerArgs: ["onBindDialogHandlers"],
event: "
}
There's no good reason for this unusual record naming, as well as the redundant level of "return function () {}" in the fixture entry - this should instead be
gpii.tests.bindDialog.checkEvent = function (eventName) { jqUnit.assert("The " + eventName + " event was fired."); };
with
{
event: "{bindDialog}
.events.onBindDialogHandlers"
listener: "gpii.tests.bindDialog.checkEvent",
args: "onBindDialogHandlers"
}