Exemplo n.º 1
0
        public void SetUp()
        {
            MockAggregate provider;
            _firstEvent = new MockEvent();
            _secondEvent = new MockEvent();

            using (var store = new Db4oEventStore("db4oTest"))
            {
                provider = new MockAggregate();
                provider.Add(_firstEvent);
                provider.Add(_secondEvent);

                store.Save(provider);
            }

            using (var store = new Db4oEventStore("db4oTest"))
            {
                _events = store.GetAllEvents(provider.Id);
            }
        }
        public void SetUp()
        {
            MockAggregate aggregate;

            using (var store = new Db4oEventStore("db4oTest"))
            {
                aggregate = new MockAggregate();
                aggregate.Add(new MockEvent());

                store.Save(aggregate);
            }

            using (IEmbeddedObjectContainer db = Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), "db4oTest"))
            {
                _aggregateInDb = (from Db4oAggregate p in db
                                 where p.Id == aggregate.Id
                                 select p).FirstOrDefault();
                _eventInDb = (from Db4oEvent e in db
                              where e.AggregateId == aggregate.Id
                              select e).FirstOrDefault();
            }
        }