Sto verificando che una classe abbia un EventHandler assegnato a un evento. Fondamentalmente sto usando il mio contenitore IoC per collegare EventHandlers per me, e sto cercando di verificare che vengano assegnati correttamente. Quindi, davvero, sto testando la mia configurazione IoC.Test di un evento a cui è assegnato un EventHandler
[Test]
public void create_person_event_handler_is_hooked_up_by_windsor()
{
IChangePersonService changePersonService = IoC.Resolve<IChangePersonService>();
// check that changePersonService.PersonCreated has a handler attached
}
io non sono sicuro di come testare che changePersonService.PersonCreated ha qualcosa collegato ad esso però.
Qualche idea?
Grazie.
Grazie Bruno, penso che sia quello che farò. – mattcole