예제 #1
0
        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));
        }
예제 #2
0
        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));
        }