public static AddressHouseNumberWasCorrected WithHouseNumber(this AddressHouseNumberWasCorrected @event, HouseNumber houseNumber) { var result = new AddressHouseNumberWasCorrected(new AddressId(@event.AddressId), houseNumber); (result as ISetProvenance).SetProvenance(@event.Provenance.ToProvenance()); return(result); }
public void GivenCorrectedHouseNumberThenHouseNumberChanged( Fixture fixture, AddressId addressId, AddressHouseNumberWasCorrected addressHouseNumberWasCorrected, ImportHouseNumberFromCrab importHouseNumberFromCrab) { addressHouseNumberWasCorrected = addressHouseNumberWasCorrected.WithHouseNumber(new Fixture().Create <HouseNumber>()); Assert(RegisteredAddressScenario(fixture) .Given(addressId, addressHouseNumberWasCorrected) .When(importHouseNumberFromCrab) .Then(addressId, new AddressHouseNumberWasChanged(addressId, importHouseNumberFromCrab.HouseNumber), importHouseNumberFromCrab.ToLegacyEvent())); }
public async Task AddressHouseNumberWasCorrectedSetsHouseNumber( AddressId addressId, Provenance provenance, AddressWasRegistered addressWasRegistered) { var addressHouseNumberWasCorrected = new AddressHouseNumberWasCorrected(addressId, new HouseNumber("17")); ((ISetProvenance)addressHouseNumberWasCorrected).SetProvenance(provenance); await Assert( Given(addressWasRegistered, addressHouseNumberWasCorrected) .Expect(ctx => ctx.AddressList, new AddressListItem { AddressId = addressWasRegistered.AddressId, StreetNameId = addressWasRegistered.StreetNameId, HouseNumber = addressHouseNumberWasCorrected.HouseNumber })); }
private void When(AddressHouseNumberWasCorrected @event) { HouseNumber = new HouseNumber(@event.HouseNumber); }