public void RaiseEvent_WhenEventNotSupportedByAggregatePassed_MustThrowException() { // Arrange var unsupportedEvent = new TestUnsupportedEvent(); var subject = new TestAggregate(); // Act TestDelegate action = () => subject.InvokeRaiseEvent(unsupportedEvent); // Assert Assert.That(action, Throws.Exception.TypeOf <UnsupportedEventException>()); }
public void LoadFromHistory_WhenEventNotSupportedByAggregatePassed_MustThrowException() { // Arrange var unsupportedEvent = new TestUnsupportedEvent(); var subject = new TestAggregate(); // Act TestDelegate action = () => subject.LoadFromHistory(new IEvent[] { unsupportedEvent }); // Assert Assert.That(action, Throws.Exception.TypeOf <UnsupportedEventException>()); }