public async Task DeleteAsyncTest() { var jobId = _fixture.Create <string>(); var entity = _fixture.Create <JobTableEntity>(); _tableStorageClientMock .Setup(x => x.ExecuteQueryAsync(It.Is <TableQuery <JobTableEntity> >(q => IsCorrectQueryForJobId(q, jobId)))) .ReturnsAsync(new JobTableEntity[] { entity }); _tableStorageClientMock .Setup(x => x.DoDeleteAsync(entity, It.IsAny <Func <JobTableEntity, object> >())) .ReturnsAsync(new TableStorageResponse <object> { Status = TableStorageResponseStatus.Successful }); await _repository.DeleteAsync(jobId); _tableStorageClientMock .Verify(x => x.DoDeleteAsync(entity, It.IsAny <Func <JobTableEntity, object> >())); }