示例#1
0
        public void WhenModificationIsCorrection(
            Fixture fixture,
            AddressId addressId,
            ImportHouseNumberMailCantonFromCrab importHouseNumberMailCantonFromCrab)
        {
            importHouseNumberMailCantonFromCrab = importHouseNumberMailCantonFromCrab
                                                  .WithCrabModification(CrabModification.Correction);

            Assert(RegisteredAddressScenario(fixture)
                   .Given <AddressPostalCodeWasChanged>(addressId)
                   .When(importHouseNumberMailCantonFromCrab)
                   .Then(addressId,
                         new AddressPostalCodeWasCorrected(addressId, new PostalCode(importHouseNumberMailCantonFromCrab.MailCantonCode)),
                         importHouseNumberMailCantonFromCrab.ToLegacyEvent()));
        }
示例#2
0
        public void ThenAddressPostalCodeWasRemovedWhenModificationIsDelete(
            Fixture fixture,
            AddressId addressId,
            AddressPostalCodeWasChanged addressPostalCodeWasChanged,
            AddressHouseNumberMailCantonWasImportedFromCrab addressHouseNumberMailCantonWasImportedFromCrab,
            ImportHouseNumberMailCantonFromCrab importHouseNumberMailCantonFromCrab
            )
        {
            importHouseNumberMailCantonFromCrab = importHouseNumberMailCantonFromCrab
                                                  .WithCrabModification(CrabModification.Delete)
                                                  .WithCrabMailCantonCode(new CrabMailCantonCode(addressPostalCodeWasChanged.PostalCode));

            addressHouseNumberMailCantonWasImportedFromCrab = addressHouseNumberMailCantonWasImportedFromCrab
                                                              .WithCrabModification(CrabModification.Insert)
                                                              .WithHouseNumberMailCantonId(importHouseNumberMailCantonFromCrab.HouseNumberMailCantonId)
                                                              .WithPostalCode(addressPostalCodeWasChanged.PostalCode);

            Assert(RegisteredAddressScenario(fixture)
                   .Given(addressId, addressPostalCodeWasChanged, addressHouseNumberMailCantonWasImportedFromCrab)
                   .When(importHouseNumberMailCantonFromCrab)
                   .Then(addressId,
                         new AddressPostalCodeWasRemoved(addressId),
                         importHouseNumberMailCantonFromCrab.ToLegacyEvent()));
        }