Hi All,
I had a question on testing wired up UI control event handlers using Rhino
Mocks.
Currently in my presenter I have this code (MenuDetails is a property on my
interface that returns the actual details view control on the UI page and the
control is returned with a getter so I can subscribe to control events in my
presenter)...
// presenter method
public void Initialize()
{
// UI layer event handlers for the details view
this.view.MenuDetails.ModeChanging += new
DetailsViewModeEventHandler(modeChanged);
this.view.MenuDetails.ItemCommand += new
DetailsViewCommandEventHandler(DetailsItemCommand);
this.view.MenuDetails.ItemInserting += new
DetailsViewInsertEventHandler(MenuDetails_ItemInserting);
this.view.MenuDetails.ItemUpdating += new
DetailsViewUpdateEventHandler(MenuDetails_ItemUpdating);
...
}
With the way I have this programmed in my presenter, I cannot seem to think of
a way to use rhino mocks to test that the UI control events were subscribed to
since the UI control events are not in my interface.
Is it possible to put a UI control event in the view interface to test that it
is subscribed/delegated to?
For example...
public interface IEmployeeView
{
// fake event handler for illistration
event DetailsViewItemUpdatingEventHandler ItemUpdating;
event EventHandler Load;
}
When I implement this interface in the employee.aspx page, the Load is valid
and you do not need to write specific implementation for it. However, I cannot
figure out a way to perform this same routine for UI controls such as a button
click event on the UI page, detail view ItemUpdating event, and so on so I do
not have to implement them, the page would just see the events in the IEmployee
interface as already valid due to the controls on the .aspx page.
Is there any way I can get UI control event handlers to work in an interface so
I can test that the UI control events were subscribed to in my presenter?
All feedback, offered revisions to my routine, and alternative options welcomed!
Thanks if you can help!
/Justin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---