public void CreateCaseReport_NullObject_NullReferenceException() { // Arrange var(unitOfWork, caseReportRepo, dbCollection) = GetMocks(); var service = new CaseReportService(unitOfWork.Object); // Act + Assert Assert.ThrowsAsync <NullReferenceException>(async() => await service.CreateCaseReport(null)); }
public async Task CreateCaseReport_FullInfo_Success() { // Arrange var(unitOfWork, caseReportRepo, dbCollection) = GetMocks(); var service = new CaseReportService(unitOfWork.Object); var caseReport = new CaseReport { Id = 28, Diagnosis = "New Diagnosis", Description = "New Description" }; // Act await service.CreateCaseReport(caseReport); // Assert Assert.IsTrue(dbCollection.ContainsKey(caseReport.Id)); }