public async void InsertDocumentAsync() { _logger.LogInformation("InsertDocumentAsync..."); var newItem = new Document() { Name = $"REPOSITORY_TEST_{DateTime.Now:yyyyMMddHHmmssfff}.jpg", Type = "jpg", Data = await File.ReadAllBytesAsync("./TestFiles/Test.jpg") }; using (var dbTransaction = await _dbConnectionFactory.BeginUserTransactionAsync(_userId)) { try { var result = await _repository.InsertDocumentAsync(dbTransaction, newItem); dbTransaction.Commit(); Assert.NotNull(result); Assert.NotEqual(newItem.DocumentId, result.DocumentId); } catch { dbTransaction.Rollback(); throw; } } }