public static AddressStreetNameWasChanged WithStreetNameId(this AddressStreetNameWasChanged @event, StreetNameId streetNameId) { var result = new AddressStreetNameWasChanged(new AddressId(@event.AddressId), streetNameId); (result as ISetProvenance).SetProvenance(@event.Provenance.ToProvenance()); return(result); }
public void GivenStreetNameThenAddressStreetNameWasChanged( Fixture fixture, AddressId addressId, StreetNameId streetNameId, AddressStreetNameWasChanged streetNameWasChanged, ImportHouseNumberFromCrab importHouseNumberFromCrab) { streetNameWasChanged = streetNameWasChanged.WithStreetNameId(new Fixture().Customize(new WithStreetNameIdExcept(streetNameId)).Create <StreetNameId>()); Assert(RegisteredAddressScenario(fixture) .Given(addressId, streetNameWasChanged) .When(importHouseNumberFromCrab) .Then(addressId, new AddressStreetNameWasChanged(addressId, StreetNameId.CreateFor(importHouseNumberFromCrab.StreetNameId)), importHouseNumberFromCrab.ToLegacyEvent())); }
private void When(AddressStreetNameWasChanged @event) { StreetNameId = new StreetNameId(@event.StreetNameId); }