... Really sending a perviously stored notification just requires doing a super.SendNotificaiton call...
Thanks for the idea, here is a simple example of notjones concept:
--Facade--
public var incommingNotificationAray:ArrayCollection = new ArrayCollection();
public var sentNotificationArray:ArrayCollection = new ArrayCollection();
override public function sendNotification(notificationName:String, body:Object = null, type:String = null):void
{
var aNotification:Notification = new Notification(notificationName, body, type);
incommingNotificationAray.addItem(aNotification);
}
public function sendNote(notification:Notification):void {
incommingNotificationAray.removeItemAt(incommingNotificationAray.getItemIndex(notification));
sentNotificationArray.addItem(notification);
super.sendNotification(notification.getName(), notification.getBody(), notification.getType());
}
public function wasReceived(notificationName:String ):Notification {
var i:int;
var arr:Array = incommingNotificationAray.source;
while(i < arr.length) {
if(Notification(arr
).getName() == notificationName) {
return arr as Notification;
}
i++;
}
return null;
}
--TestCase--
public function testSaveHistory():void {
var historyProxy:HistoryProxy = registerProxy();
facade.sendNotification(ApplicationFacade.SAVE_USER_ACTION, new HistoryVO());
var receivedNote:Notification = facade.wasReceived(ApplicationFacade.SAVE_USER_ACTION);
if(receivedNote) {
facade.sendNote(receivedNote);
}
assertTrue("there is 1 item in the history list", historyProxy.historyArray.length == 1);
}