public async Task WhenITryToSaveTheNewEventsInTheStream() { using (var session = await sessionContainer.StartSession(streamInfo.Id)) { session.AddEvents(eventsContainer.LastEventsCreated); //The implementation is sync-based. Async it stubbed. recordedException = await Record.ExceptionAsync(() => session.SaveChanges()); } }
public async Task WhenILoadMyEntity() { using (var session = await sessionContainer.StartSession(streamInfo.Id)) { lastStateContainer.LatestLoadedState = session.GetCurrentState(); } }
public async Task GivenIStartSessionAndIAddEvent(int sessionIndex, int eventCount) { activeSessions[sessionIndex] = await sessionContainer.StartSession(streamInfo.Id); activeSessions[sessionIndex].AddEvents(eventGenerator.GenerateEvents(eventCount)); }