示例#1
0
        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));
        }
示例#2
0
        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));
        }