Exemplo n.º 1
0
        public void Applying_an_event_that_is_already_owned_by_another_source_should_cause_an_exception()
        {
            var theEvent = new HandledEvent();

            theEvent.OverrideAggregateRootId(Guid.NewGuid());
            var theAggregate = new MyAggregateRoot();

            Action act = () => theAggregate.ApplyEvent(theEvent);

            act.ShouldThrow <InvalidOperationException>();
        }
Exemplo n.º 2
0
        public void Applying_an_event_that_is_already_owned_by_another_source_should_cause_an_exception()
        {
            var theEvent = new HandledEvent();
            theEvent.OverrideAggregateRootId(Guid.NewGuid());
            var theAggregate = new MyAggregateRoot();

            Action act = () => theAggregate.ApplyEvent(theEvent);

            act.ShouldThrow<InvalidOperationException>();
        }