コード例 #1
0
        public void EmitEvents()
        {
            var aggregate = new TestAggregate();

            aggregate.TestMethod();
            Assert.AreEqual(1, aggregate.Events.Count());
            aggregate.TestMethod();
            Assert.AreEqual(2, aggregate.Events.Count());
        }
コード例 #2
0
        public void CallEventApplicatorAndEmitEvent()
        {
            var aggregate = new TestAggregate(1, 1);

            aggregate.TestMethod();
            Assert.AreEqual(1, aggregate.Events.Count());
            Assert.IsInstanceOfType(aggregate.Events.First(), typeof(TestEvent));
            Assert.AreEqual(1, aggregate.InvokeCount);
        }