Esempio n. 1
0
 /// <summary>
 /// Applies the event.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="domainEvent">The domain event.</param>
 public AggregateRoot <TEntity, TId> AddEvent(TId id, IDomainEvent <TEntity> domainEvent)
 {
     return(Factory.GetAndApplyEvent(id, domainEvent, (root, @event) => RefuseEngine.Refuse(root, @event)));
 }
Esempio n. 2
0
        public void CreateNewShip()
        {
            var arrivalEvent = new ArrivalEvent {
                Port = new Port {
                    Name = "Barcelona"
                }, Version = 1
            };

            var aggreate = _aggregateFactory.GetAndApplyEvent(_ship.Id, arrivalEvent);

            Assert.AreEqual("Barcelona", aggreate.Root.Port.Name);
        }