Without asking what you are pretending to be, the only way to test and list registered events is to register them in your own collection.
See this example:
public class MyChangePersonService : IChangePersonService
{
private IList<EventHandler> handlers;
private EventHandler _personEvent;
public event EventHandler PersonCreated
{
add
{
_personEvent += value;
handlers.Add(value);
}
remove
{
_personEvent -= value;
handlers.Remove(value);
}
}
public IList<EventHandler> PersonEventHandlers { get { return handlers; } }
public MyChangePersonService()
{
handlers = new List<EventHandler>();
}
public void FirePersonEvent()
{
_personEvent(this, null);
}
}
prop PersonEventHandlers.
- ?