public void DeleteCaseReport_ItemDoesNotExists_NullReferenceException() { // Arrange var(unitOfWork, caseReportRepo, dbCollectionCaseReport) = GetMocks(); var service = new CaseReportService(unitOfWork.Object); var caseReport = new CaseReport { Id = 0, Diagnosis = "Delete Diagnosis" }; // Act + Assert Assert.ThrowsAsync <NullReferenceException>(async() => await service.DeleteCaseReport(caseReport)); }
public async Task DeleteCaseReport_TargetItem_Success() { // Arrange var(unitOfWork, caseReportRepo, dbCollectionCaseReport) = GetMocks(); var service = new CaseReportService(unitOfWork.Object); var caseReport = new CaseReport { Id = 26, Diagnosis = "Delete Diagnosis" }; // Act await service.DeleteCaseReport(caseReport); // Assert Assert.IsFalse(dbCollectionCaseReport.ContainsKey(26)); }