public void HandlerIsCalledWhenHandlerIsProtectedAndEventIsApplied() { var domainEvent = new AggregateRootProtectedHandlerThatMeetsConventionEvent(); var aggregateRoot = new MyAggregateRoot(); aggregateRoot.Apply(domainEvent); Assert.IsTrue(aggregateRoot.OnAggregateRootProtectedHandlerThatMeetsConventionCalled); }
public void HandlerIsCalledWhenHandlerIsProtectedAndEventIsApplied() { var domainEvent = new AggregateRootProtectedHandlerThatMeetsConventionEvent(); var aggregateRoot = new MyAggregateRoot(); aggregateRoot.Apply(domainEvent); Assert.IsTrue(aggregateRoot.OnAggregateRootProtectedHandlerThatMeetsConventionCalled); }
public void WhenEventModifierIsSetModificationsAreApplied() { // Arrange var fakeModification = new FakeModification { ModifyValueTo = "Yes we can" }; var aggregateRoot = new MyAggregateRoot(); var domainEvent = new EventForModificationTestEvent(); EventModifier.Modification = fakeModification; // Act aggregateRoot.Apply(domainEvent); // Assert Assert.AreEqual(domainEvent.ModifiedValue, fakeModification.ModifyValueTo); // Teardown EventModifier.Modification = null; }
public void WhenEventModifierIsSetModificationsAreApplied() { // Arrange var fakeModification = new FakeModification { ModifyValueTo = "Yes we can" }; var aggregateRoot = new MyAggregateRoot(); var domainEvent = new EventForModificationTestEvent(); EventModifier.Modification = fakeModification; // Act aggregateRoot.Apply(domainEvent); // Assert Assert.AreEqual(domainEvent.ModifiedValue, fakeModification.ModifyValueTo); // Teardown EventModifier.Modification = null; }