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); }
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]); }