Esempio n. 1
0
        public void ShouldCreateANewEmptyAggregate()
        {
            AggregateFactory aggregateFactory = new AggregateFactory();
            SimpleAggregate  aggregate        = new SimpleAggregate();
            IAggregate       rebuiltAggregate = aggregateFactory.Build(aggregate.GetType(), aggregate.Id, null);

            rebuiltAggregate.ShouldBeEquivalentTo(aggregate);
        }
Esempio n. 2
0
        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);
        }