public async Task GetAll_ReturnsAllAdded() { var store = new InMemoryJobStore(loggerMock.Object); await store.Save(IDGenerator.GenerateNewId(), sortingJob); await store.Save(IDGenerator.GenerateNewId(), sortingJob); var jobs = await store.GetAll(); jobs.Should().HaveCount(2); jobs.Should().NotContainNulls(); }
public async Task Save_RespectsThreads() { // Best effort thread test var store = new InMemoryJobStore(loggerMock.Object); Parallel.For(0, 100, async(i) => { await store.Save(IDGenerator.GenerateNewId(), sortingJob); }); var allItems = await store.GetAll(); allItems.Should().NotContainNulls(); allItems.Should().HaveCount(100); }