Ejemplo n.º 1
0
        public void ApplyEvent_WithUnsupportedEvent_ThrowsUnapplicableEventException()
        {
            // Arrange
            var mockAggregate = new FakeAggregate();
            var stubEvent     = new UnappliedEvent();

            // Act
            Action applyUnapplicable = () => mockAggregate.ApplyEvent(stubEvent);

            // Assert
            Assert.Throws <UnapplicableEvent>(applyUnapplicable);
        }
Ejemplo n.º 2
0
        public void ApplyEvent_WithSupportedEvent_AppliesEvent()
        {
            // Arrange
            var mockAggregate = new FakeAggregate();
            var mockEvent     = new AppliedEvent1();

            // Act
            mockAggregate.ApplyEvent(mockEvent);

            // Assert
            Assert.Equal(mockEvent, mockAggregate.applied_events[0]);
        }