public void ShouldCreateANewEmptyAggregate() { AggregateFactory aggregateFactory = new AggregateFactory(); SimpleAggregate aggregate = new SimpleAggregate(); IAggregate rebuiltAggregate = aggregateFactory.Build(aggregate.GetType(), aggregate.Id, null); rebuiltAggregate.ShouldBeEquivalentTo(aggregate); }
public void ShouldRehydrateTheAggregateFromSnapshot() { AggregateFactory aggregateFactory = new AggregateFactory(); SimpleAggregate aggregate = new SimpleAggregate(Guid.NewGuid(), DateTime.Now); IAggregate rebuiltAggregate = aggregateFactory.Build(aggregate.GetType(), aggregate.Id, ((IMementoCreator)aggregate).CreateMemento()); rebuiltAggregate.ShouldBeEquivalentTo(aggregate); }