public void ThenNoStatusChangeIfLifetimeIsFinite( Fixture fixture, AddressId addressId, ImportHouseNumberFromCrab importHouseNumberFromCrab) { importHouseNumberFromCrab = importHouseNumberFromCrab .WithLifetime(new Fixture().Customize(new NodaTimeCustomization()).Customize(new WithFiniteLifetime()).Create <CrabLifetime>()); Assert(RetiredAddressScenario(fixture) .When(importHouseNumberFromCrab) .Then(addressId, importHouseNumberFromCrab.ToLegacyEvent())); }
public void ThenAddressWasCorrectedToRetiredIfLifetimeIsFiniteAndCorrection( Fixture fixture, AddressId addressId, ImportHouseNumberFromCrab importHouseNumberFromCrab) { importHouseNumberFromCrab = importHouseNumberFromCrab. WithLifetime(new Fixture().Customize(new NodaTimeCustomization()).Customize(new WithFiniteLifetime()).Create <CrabLifetime>()) .WithCrabModification(CrabModification.Correction); Assert(RegisteredAddressScenario(fixture) .When(importHouseNumberFromCrab) .Then(addressId, new AddressWasCorrectedToRetired(addressId), importHouseNumberFromCrab.ToLegacyEvent())); }
public void GivenAddressPositionHasEndDate( IFixture fixture, AddressId addressId, AddressHouseNumberPositionWasImportedFromCrab addressHouseNumberPositionWasImported, ImportHouseNumberFromCrab importHouseNumberFromCrab) { addressHouseNumberPositionWasImported = addressHouseNumberPositionWasImported .WithEndDate(DateTimeOffset.Now) .WithCrabAddressPositionOrigin(CrabAddressPositionOrigin.ManualIndicationFromEntryOfBuilding); importHouseNumberFromCrab = importHouseNumberFromCrab .WithLifetime(new CrabLifetime(LocalDateTime.FromDateTime(DateTime.Now), LocalDateTime.FromDateTime(DateTime.Now.AddDays(1)))); Assert(RegisteredAddressScenario(fixture) .Given(addressId, addressHouseNumberPositionWasImported) .When(importHouseNumberFromCrab) .Then(addressId, new AddressWasRetired(addressId), new AddressWasPositioned(addressId, new AddressGeometry(GeometryMethod.AppointedByAdministrator, GeometrySpecification.Entry, GeometryHelpers.CreateEwkbFrom(new WkbGeometry(addressHouseNumberPositionWasImported.AddressPosition)))), importHouseNumberFromCrab.ToLegacyEvent())); }