public void ThenNoPositionChangeWhenOlderLifetimeAndLessQuality( Fixture fixture, AddressId addressId, AddressWasRegistered addressWasRegistered, WkbGeometry wkbGeometry, AddressSubaddressPositionWasImportedFromCrab addressSubaddressPositionWasImportedFromCrab, ImportSubaddressPositionFromCrab importSubaddressPositionFromCrab) { var addressWasPositioned = new AddressWasPositioned(addressId, new AddressGeometry(GeometryMethod.AppointedByAdministrator, GeometrySpecification.Stand, GeometryHelpers.CreateEwkbFrom(wkbGeometry))); ((ISetProvenance)addressWasPositioned).SetProvenance(fixture.Create <Provenance>()); addressSubaddressPositionWasImportedFromCrab = addressSubaddressPositionWasImportedFromCrab .WithWkbGeometry(wkbGeometry) .WithCrabAddressPositionOrigin(CrabAddressPositionOrigin.ManualIndicationFromStand); importSubaddressPositionFromCrab = importSubaddressPositionFromCrab .WithCrabAddressPositionOrigin(CrabAddressPositionOrigin.ManualIndicationFromLot) .WithLifetime(new CrabLifetime(addressSubaddressPositionWasImportedFromCrab.BeginDateTime.Value.PlusDays(-1), addressSubaddressPositionWasImportedFromCrab.EndDateTime)); Assert(new Scenario() .Given(addressId, addressWasRegistered, addressWasPositioned, addressSubaddressPositionWasImportedFromCrab) .When(importSubaddressPositionFromCrab) .Then(addressId, importSubaddressPositionFromCrab.ToLegacyEvent())); }
public void WithRemovedPositionWhenSameLifetimeOfPreviouslyRemovedPosition( Fixture fixture, AddressId addressId, AddressWasRegistered addressWasRegistered, WkbGeometry wkbGeometry, AddressSubaddressPositionWasImportedFromCrab addressSubaddressPositionWasImportedFromCrab, AddressPositionWasRemoved addressPositionWasRemoved, AddressSubaddressPositionWasImportedFromCrab addressSubaddressPositionWasImportedFromCrabDelete, ImportSubaddressPositionFromCrab importSubaddressPositionFromCrab, CrabLifetime lifetime) { var addressWasPositioned = new AddressWasPositioned(addressId, new AddressGeometry(GeometryMethod.AppointedByAdministrator, GeometrySpecification.Lot, GeometryHelpers.CreateEwkbFrom(wkbGeometry))); ((ISetProvenance)addressWasPositioned).SetProvenance(fixture.Create <Provenance>()); addressSubaddressPositionWasImportedFromCrab = addressSubaddressPositionWasImportedFromCrab .WithWkbGeometry(wkbGeometry) .WithCrabAddressPositionOrigin(CrabAddressPositionOrigin.ManualIndicationFromLot) .WithBeginDate(lifetime.BeginDateTime); addressSubaddressPositionWasImportedFromCrabDelete = addressSubaddressPositionWasImportedFromCrabDelete .WithWkbGeometry(wkbGeometry) .WithCrabAddressPositionOrigin(CrabAddressPositionOrigin.ManualIndicationFromLot) .WithBeginDate(lifetime.BeginDateTime) .WithModification(CrabModification.Delete); importSubaddressPositionFromCrab = importSubaddressPositionFromCrab .WithCrabAddressPositionOrigin(CrabAddressPositionOrigin.ManualIndicationFromStand) .WithLifetime(lifetime); Assert(new Scenario() .Given(addressId, addressWasRegistered, addressWasPositioned, addressSubaddressPositionWasImportedFromCrab, addressPositionWasRemoved, addressSubaddressPositionWasImportedFromCrabDelete ) .When(importSubaddressPositionFromCrab) .Then(addressId, new AddressWasPositioned(addressId, new AddressGeometry(GeometryMethod.AppointedByAdministrator, GeometrySpecification.Stand, GeometryHelpers.CreateEwkbFrom(importSubaddressPositionFromCrab.AddressPosition))), importSubaddressPositionFromCrab.ToLegacyEvent())); }