Example #1
0
        public void All_the_events_from_a_new_event_source_should_add_events_to_event_store()
        {
            var mock = MockRepository.GenerateMock<IEventSource>();
            mock.Stub(m => mock.Id).Return(Guid.NewGuid()).Repeat.Any();
            mock.Stub(m => mock.GetUncommittedEvents()).Return(new ISourcedEvent[] { new FooEvent(mock.Id, 1), new BarEvent(mock.Id, 2) });

            var theEventStore = new AzureEventStore();
            theEventStore.Save(mock);

            var storedEvents = theEventStore.GetAllEvents(mock.Id);
            storedEvents.Count().Should().Be(2);
        }