Ejemplo n.º 1
0
        public void WhenRehydrateAndCreates_ThenReturnsInstance()
        {
            var result = TestAggregateRoot.Rehydrate()("anid".ToIdentifier(), this.dependencyContainer.Object,
                                                       new Dictionary <string, object>());

            result.Id.Should().Be("anid".ToIdentifier());
        }
Ejemplo n.º 2
0
        public void WhenRehydrate_ThenRaisesNoEvents()
        {
            var container = new Mock <IDependencyContainer>();

            container.Setup(c => c.Resolve <IRecorder>())
            .Returns(NullRecorder.Instance);
            container.Setup(c => c.Resolve <IIdentifierFactory>())
            .Returns(new NullIdentifierFactory());

            var created =
                TestAggregateRoot.Rehydrate()("anid".ToIdentifier(), container.Object,
                                              new Dictionary <string, object>());

            created.GetChanges().Should().BeEmpty();
            created.LastPersistedAtUtc.Should().BeNull();
            created.CreatedAtUtc.Should().Be(DateTime.MinValue);
            created.LastModifiedAtUtc.Should().Be(DateTime.MinValue);
        }