public void ShouldReturnABusEventForAccommodationLeadCreated() { var id = Guid.NewGuid(); var mapper = new AccommodationLeadCreatedMapper(); var domainEvent = new AccommodationLeadCreated { ID = id, Name = "Something", Email = "*****@*****.**" }; Assert.That(mapper.Map(domainEvent), Is.TypeOf <Messages.Events.AccommodationLeadCreated>()); }
public void ShouldCreateANewAccommodationLead() { var id = Guid.NewGuid(); const string name = "Something"; const string email = "*****@*****.**"; var handler = new AccommodationLeadCreated(Repository); var @event = new Messages.Events.AccommodationLeadCreated { AccommodationLeadID = id, Name = name, Email = email }; handler.Handle(@event); Repository.AssertWasCalled(x => x.Save(Arg <AccommodationLead> .Is.Anything)); }
private void Apply(AccommodationLeadCreated @event) { ID = @event.ID; _name = @event.Name; _email = @event.Email; }