예제 #1
0
        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;
        }
예제 #2
0
        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;
        }