Ejemplo n.º 1
0
        public void WhenAutoWiredDomainActionPerformed_ThenRootChangesStateThroughEvent()
        {
            var root = new AutoWiredTestRoot();

            root.Publish(5);

            Assert.Equal(5, root.LatestVersion);
            Assert.True(root.GetEvents().Any());
            Assert.True(root.GetEvents().OfType <TestPublished>().Any(x => x.Version == 5));
        }
Ejemplo n.º 2
0
        public void WhenSubsequentAutoWiredDomainActionPerformed_ThenRootChangesStateThroughEvent()
        {
            var root = new AutoWiredTestRoot();

            root.Publish(5);

            Assert.True(root.IsPublished);

            root.Unpublish();

            Assert.False(root.IsPublished);
        }