public void Save_WithConcurrencyConflict_ThrowsConcurrencyConflictOccurredException() { // Arrange var stubInMemoryEventStore = new InMemoryEventStore(); var stubGuid = Guid.NewGuid(); var mockEventList = new ArrayList() { new Event1(), new Event2() }; // Act Action saveConcurrencyConflict = () => stubInMemoryEventStore .Save(new AdditionalEvents(stubGuid, mockEventList, 2)); // Assert Assert.Throws <ConcurrencyConflictOccurred>(saveConcurrencyConflict); }
public void LoadEventsFor_SavedEventsWithSameGUID_ReturnsSavedEvents() { // Arrange var stubInMemoryEventStore = new InMemoryEventStore(); var stubGuid = Guid.NewGuid(); var mockEventList = new ArrayList() { new Event1(), new Event2() }; stubInMemoryEventStore.Save( new AdditionalEvents(stubGuid, mockEventList)); // Act var loadedEvents = stubInMemoryEventStore.LoadEventsFor(stubGuid); // Assert Assert.Equal(mockEventList, loadedEvents); }