Ejemplo n.º 1
0
        private static IEventStore BuildEventStore()
        {
            var path  = Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data\\EventStore");
            var store = new NoDBEventStore(path);

            return(store);
        }
 public void BaseSetup()
 {
     EventStore = new NoDBEventStore("./NoDBTests/"+GetType().Name);
     EventSourceId = Guid.NewGuid();
     Guid entityId = Guid.NewGuid();
     Events = new object[] {new AccountTitleChangedEvent("Title")};
     var eventStream = Prepare.Events(Events)
         .ForSourceUncomitted(EventSourceId, Guid.NewGuid());
     EventStore.Store(eventStream);
 }
Ejemplo n.º 3
0
        public NoDBEventStoreTestFixture()
        {
            EventStore    = new NoDBEventStore("./NoDBTests/" + GetType().Name);
            EventSourceId = Guid.NewGuid();
            Guid entityId = Guid.NewGuid();

            Events = new object[] { new AccountTitleChangedEvent("Title") };
            var eventStream = Prepare.Events(Events)
                              .ForSourceUncomitted(EventSourceId, Guid.NewGuid());

            EventStore.Store(eventStream);
        }
Ejemplo n.º 4
0
 public void BaseSetup()
 {
     EventStore = new NoDBEventStore("./");
     Source = MockRepository.GenerateMock<IEventSource>();
     Guid id = Guid.NewGuid();
     int sequenceCounter = 1;
     Events = new SourcedEvent[]
                  {
                      new CustomerCreatedEvent(Guid.NewGuid(), id, sequenceCounter++, DateTime.UtcNow, "Foo",
                                               35),
                      new CustomerNameChanged(Guid.NewGuid(), id, sequenceCounter++, DateTime.UtcNow,
                                              "Name" + sequenceCounter),
                      new CustomerNameChanged(Guid.NewGuid(), id, sequenceCounter++, DateTime.UtcNow,
                                              "Name" + sequenceCounter)
                  };
     Source.Stub(e => e.EventSourceId).Return(id);
     Source.Stub(e => e.InitialVersion).Return(0);
     Source.Stub(e => e.Version).Return(Events.Length);
     Source.Stub(e => e.GetUncommittedEvents()).Return(Events);
     EventStore.Save(Source);
 }
Ejemplo n.º 5
0
        public void BaseSetup()
        {
            EventStore = new NoDBEventStore("./");
            Source     = MockRepository.GenerateMock <IEventSource>();
            Guid id = Guid.NewGuid();
            int  sequenceCounter = 1;

            Events = new SourcedEvent[]
            {
                new CustomerCreatedEvent(Guid.NewGuid(), id, sequenceCounter++, DateTime.UtcNow, "Foo",
                                         35),
                new CustomerNameChanged(Guid.NewGuid(), id, sequenceCounter++, DateTime.UtcNow,
                                        "Name" + sequenceCounter),
                new CustomerNameChanged(Guid.NewGuid(), id, sequenceCounter++, DateTime.UtcNow,
                                        "Name" + sequenceCounter)
            };
            Source.Stub(e => e.EventSourceId).Return(id);
            Source.Stub(e => e.InitialVersion).Return(0);
            Source.Stub(e => e.Version).Return(Events.Length);
            Source.Stub(e => e.GetUncommittedEvents()).Return(Events);
            EventStore.Save(Source);
        }