public void WhenInstantiateAndCreates_ThenReturnsInstance() { var result = TestAggregateRoot.Instantiate()("anid".ToIdentifier(), this.dependencyContainer.Object, new Dictionary <string, object>()); result.Id.Should().Be("anid".ToIdentifier()); }
public void WhenInstantiate_ThenRaisesNoEvents() { var container = new Mock <IDependencyContainer>(); container.Setup(c => c.Resolve <ILogger>()) .Returns(NullLogger.Instance); container.Setup(c => c.Resolve <IIdentifierFactory>()) .Returns(new NullIdentifierFactory()); var created = TestAggregateRoot.Instantiate()("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); }