public void Aggregate_by_default_can_be_saved_as_IMemento_for_snapshot() { _aggregate = new TestAggregate(1, Guid.NewGuid().ToString()); var factory = new AggregateFactory(); var snapshot = factory.GetSnapshot(_aggregate); _restoredAggregate = factory.Build <TestAggregate>(_aggregate.Id, snapshot); // Restored_aggregate_is_not_null() Assert.NotNull(_restoredAggregate); // Ids_are_equal() Assert.Equal(_aggregate.Id, _restoredAggregate.Id); //Restored_aggregate_uncommitted_events_are_empty() Assert.Empty(((IAggregate)_restoredAggregate).GetUncommittedEvents()); //Restored_aggregate_state_is_equal_to_origin() Assert.Equal(_aggregate.Value, _restoredAggregate.Value); }