Beispiel #1
0
        public void AddressAddedToAssociation_AddressDetailsAdded()
        {
            var addressAddedToAssociationEvent = new AddressAddedToAssociation
            {
                Id            = "aId",
                StreetAddress = "aSa",
                No            = "aNo",
                Floor         = "aF",
                Door          = "aD",
                City          = "aC",
                Zip           = "aZ",
                Country       = "aCo"
            };

            var association = new Association();

            association.Apply(addressAddedToAssociationEvent);

            association.Addresses[0].Id.ShouldBe(addressAddedToAssociationEvent.Id);
            association.Addresses[0].StreetAddress.ShouldBe(addressAddedToAssociationEvent.StreetAddress);
            association.Addresses[0].No.ShouldBe(addressAddedToAssociationEvent.No);
            association.Addresses[0].Floor.ShouldBe(addressAddedToAssociationEvent.Floor);
            association.Addresses[0].Door.ShouldBe(addressAddedToAssociationEvent.Door);
            association.Addresses[0].City.ShouldBe(addressAddedToAssociationEvent.City);
            association.Addresses[0].Zip.ShouldBe(addressAddedToAssociationEvent.Zip);
            association.Addresses[0].Country.ShouldBe(addressAddedToAssociationEvent.Country);
        }
Beispiel #2
0
        public void Handle(IViewContext context, AddressAddedToAssociation domainEvent)
        {
            var address = new AssociationAddress();

            address.MapFromEvent(domainEvent);

            _addresses.Add(address);
        }
Beispiel #3
0
        public GetAddressesViewTests()
        {
            var associationId = "ass123";

            _addressAddedToAssociationEvent     = DomainEventHelper.Create <AddressAddedToAssociation>(associationId);
            _addressRemovedFromAssociationEvent = DomainEventHelper.Create <AddressRemovedFromAssociation>(associationId);
            _codeAssignedToAddressEvent         = DomainEventHelper.Create <CodeAssignedToAddress>(associationId);
        }
Beispiel #4
0
        public void Handle(IViewContext context, AddressAddedToAssociation domainEvent)
        {
            var associationId   = domainEvent.GetAggregateRootId();
            var addressWithCode = new AssociationAddressCode();

            addressWithCode.AssociationId = associationId;
            addressWithCode.MapFromEvent(domainEvent);

            GetAssociationAddressList(associationId).Add(addressWithCode);
        }
 public void MapFromEvent(AddressAddedToAssociation domainEvent)
 {
     this.Id            = domainEvent.Id;
     this.StreetAddress = domainEvent.StreetAddress;
     this.No            = domainEvent.No;
     this.Floor         = domainEvent.Floor;
     this.Door          = domainEvent.Door;
     this.City          = domainEvent.City;
     this.Zip           = domainEvent.Zip;
     this.Country       = domainEvent.Country;
 }
        public void Handle(IViewContext context, AddressAddedToAssociation domainEvent)
        {
            var address = new Models.View.Association.Address
            {
                Id            = domainEvent.Id,
                StreetAddress = domainEvent.StreetAddress,
                No            = domainEvent.No,
                Floor         = domainEvent.Floor,
                Door          = domainEvent.Door,
                City          = domainEvent.City,
                Zip           = domainEvent.Zip,
                Country       = domainEvent.Country
            };

            FindInternalAssociation(domainEvent).Addresses.Add(address);
        }
Beispiel #7
0
        public void Apply(AddressAddedToAssociation e)
        {
            var address = new Address
            {
                Id            = e.Id,
                StreetAddress = e.StreetAddress,
                No            = e.No,
                Floor         = e.Floor,
                Door          = e.Door,
                City          = e.City,
                Zip           = e.Zip,
                Country       = e.Country
            };

            Addresses.Add(address);
        }