Esempio n. 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;
        }
Esempio n. 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;
        }