public void GivenAnEventWhenCastToATypedReferenceThenTheTypedReferenceIsReturned()
        {
            var aggregate = new SerializableEventCentricAggregateRoot();
            var message   = new SerializableMessage();
            var @event    = new SerializableDomainEvent <SerializableEventCentricAggregateRoot>(message, aggregate);
            Reference <SerializableEventCentricAggregateRoot> reference = @event;

            Assert.True(reference.IsMatch(aggregate));
        }
Пример #2
0
        public void GivenAContextAndAnAggregateThenTheContextAndAggregateReferenceArePropagated()
        {
            var aggregate = new SerializableAggregateRoot();
            var context   = new SerializableMessage();

            var @event = new SerializableDomainEvent <SerializableAggregateRoot>(context, aggregate);

            Assert.True(@event.Aggregate.IsMatch(aggregate));
            Assert.Equal(context.Id, @event.CausationId);
            Assert.Equal(context.CorrelationId, @event.CorrelationId);
        }