public void ShouldReturnABusEventForAccommodationSupplierCreated() { var id = Guid.NewGuid(); var mapper = new AccommodationSupplierCreatedMapper(); var domainEvent = new AccommodationSupplierCreated { ID = id, Name = "Something", Email = "*****@*****.**" }; Assert.That(mapper.Map(domainEvent), Is.TypeOf <Messages.Events.AccommodationSupplierCreated>()); }
public void ShouldCreatedAnAccommmodationSupplier() { var id = Guid.NewGuid(); const string name = "test"; const string email = "*****@*****.**"; var @event = new AccommodationSupplierCreated { AccommodationSupplierId = id, Name = name, Email = email }; var handler = new Subscribers.AccommodationSupplierCreated(Repository); handler.Handle(@event); Repository.AssertWasCalled(x => x.Save(Arg <AccommodationSupplier> .Is.Anything)); }
private void Apply(AccommodationSupplierCreated @event) { this.ID = @event.ID; this._name = @event.Name; this._email = @event.Email; }