public async Task EventRepository_AddOrUpdate_WithRecordsThatDoAndDoNotExistInDb_CreatesRecords() { var SaveChangesAsyncWasCalled = false; ShimDbContext.AllInstances.SaveChangesAsync = (x) => { SaveChangesAsyncWasCalled = true; int task = Convert.ToInt32(SaveChangesAsyncWasCalled); return(Task.FromResult(task)); }; var list = new List <EventEntity>(EventHelper.GetEventEntityList()); await ClassUnderTest.AddOrUpdateAsync(list); Assert.True(SaveChangesAsyncWasCalled); }