public void GetCaseReportById_ItemDoesNotExists_KeyNotFoundException() { // Arrange var(unitOfWork, caseReportRepo, dbCollectionCaseReport) = GetMocks(); var service = new CaseReportService(unitOfWork.Object); // Act + Assert Assert.ThrowsAsync <KeyNotFoundException>(async() => await service.GetCaseReportById(0)); }
public async Task GetCaseReportById_ItemExists_Success() { // Arrange var(unitOfWork, caseReportRepo, dbCollectionCaseReport) = GetMocks(); var service = new CaseReportService(unitOfWork.Object); // Act var caseReport = await service.GetCaseReportById(27); // Assert Assert.AreEqual(caseReport, dbCollectionCaseReport[27]); }