public void Parent_should_raise_an_event_when_created() { NewParentCreatedEvent newParentCreatedEvent = null; DomainEvents.Register <NewParentCreatedEvent>(e => { newParentCreatedEvent = (NewParentCreatedEvent)e; }); var parent = new Parent("Dad", "*****@*****.**", "xxx").Initialise(); newParentCreatedEvent.ShouldNotBeNull(); newParentCreatedEvent.Parent.ShouldBeTheSameAs(parent); }
public void Parent_should_raise_an_event_when_created() { NewParentCreatedEvent newParentCreatedEvent = null; using (DomainEvent.TestWith(e => { newParentCreatedEvent = (NewParentCreatedEvent)e; })) { var parent = new Parent("Dad", "*****@*****.**", "xxx").Initialise(); newParentCreatedEvent.ShouldNotBeNull(); newParentCreatedEvent.Parent.ShouldBeTheSameAs(parent); } }