Exemple #1
0
        public void ThenHouseNumberChanged(
            Fixture fixture,
            AddressId addressId,
            ImportHouseNumberSubaddressFromCrab importHouseNumberSubaddressFromCrab)
        {
            importHouseNumberSubaddressFromCrab = importHouseNumberSubaddressFromCrab
                                                  .WithHouseNumber(new Fixture().Create <HouseNumber>());

            Assert(RegisteredAddressScenario(fixture)
                   .When(importHouseNumberSubaddressFromCrab)
                   .Then(addressId,
                         new AddressHouseNumberWasChanged(addressId, importHouseNumberSubaddressFromCrab.HouseNumber),
                         importHouseNumberSubaddressFromCrab.ToLegacyEvent()));
        }
        public void ThenAddressWasCorrectedToRetiredIfLifetimeIsFiniteAndCorrection(
            Fixture fixture,
            AddressId addressId,
            ImportHouseNumberSubaddressFromCrab importHouseNumberSubaddressFromCrab)
        {
            importHouseNumberSubaddressFromCrab = importHouseNumberSubaddressFromCrab
                                                  .WithLifetime(new Fixture().Customize(new NodaTimeCustomization()).Customize(new WithFiniteLifetime()).Create <CrabLifetime>())
                                                  .WithCrabModification(CrabModification.Correction);

            Assert(RegisteredAddressScenario(fixture)
                   .When(importHouseNumberSubaddressFromCrab)
                   .Then(addressId,
                         new AddressWasCorrectedToRetired(addressId),
                         importHouseNumberSubaddressFromCrab.ToLegacyEvent()));
        }
Exemple #3
0
        public void RemoveViaHouseNumberThenAddressRemovedException(
            AddressId addressId,
            AddressWasRegistered addressWasRegistered,
            AddressWasRemoved addressWasRemoved,
            ImportHouseNumberSubaddressFromCrab importHouseNumberFromCrab,
            ImportSubaddressFromCrab importSubaddressFromCrab)
        {
            importHouseNumberFromCrab = importHouseNumberFromCrab.WithCrabModification(CrabModification.Delete);

            Assert(new Scenario()
                   .Given(addressId,
                          addressWasRegistered,
                          importSubaddressFromCrab.ToLegacyEvent(),
                          addressWasRemoved)
                   .When(importHouseNumberFromCrab)
                   .Then(addressId, importHouseNumberFromCrab.ToLegacyEvent()));
        }