Jax
unread,Mar 16, 2009, 2:34:51 AM3/16/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Rhino.Mocks
Is there a way to fire an event on a mock when a method is called on
the mock?
I need this to support mocking for objects that have asynch behaviour.
_service.Stub(service =>
service.GetStaffMemberAsync(expectedServiceCall)).WhenCalled
(FireServiceGetStaffMemberCompleted);
public void FireServiceGetStaffMemberCompleted(GetStaffMemberCriteria
criteria)
{
_serviceStaffMember = Create.New().Staff().Default();
_service.Raise(x => x.GetStaffMemberCompleted += null,
_service, new GetStaffMemberCompletedEventArgs(new object[]
{_serviceStaffMember}, null, false, null));
}