Пример #1
0
        public void ShouldReturnInvalidData()
        { //arrange
            impDiagnosis diagnosis = new impDiagnosis(dbContext);
            //act
            Disease disease  = null;
            string  results  = diagnosis.DeactivateDisease(disease.Disease_id);
            string  expected = "Invalid data";

            //assert
            test = extentReport.StartTest("Save Diagnosis null instance", "Test empty instance ");
            Assert.AreEqual(expected, results);
            Console.WriteLine("test invalid data");
        }
Пример #2
0
        public void ShouldReturnDeactivatedFail()
        {
            //HPCareDBContext dbContext = MockDataContext.GetMockHPCareDBContext();
            impDiagnosis diagnosis = new impDiagnosis(dbContext);
            Disease      disease   = dbContext.Diseases.FirstOrDefault();

            string results  = diagnosis.DeactivateDisease(disease.Disease_id);
            string expected = "null";

            //assert
            test = extentReport.StartTest("Save Diagnosis-failTest", "expect null");
            Assert.AreEqual(expected, results);
        }
Пример #3
0
        public void ShouldReturnDeactivated()
        {
            //HPCareDBContext dbContext = MockDataContext.GetMockHPCareDBContext();
            impDiagnosis diagnosis = new impDiagnosis(dbContext);
            Disease      disease   = dbContext.Diseases.FirstOrDefault();

            string results  = diagnosis.DeactivateDisease(disease.Disease_id);
            string expected = "Disease Deactivated";

            //assert
            test = extentReport.StartTest("Deactivate Diagnosis ", "Assert true diagnosis size reduced by one ");
            Assert.AreEqual(expected, results);
            Console.WriteLine("should return deactivated");
        }
Пример #4
0
        public void SaveDiagnosis()
        { //arrange
            impDiagnosis diagnosis = new impDiagnosis(dbContext);
            //act
            int start = dbContext.Diagnoses.ToList().Count;
            List <CID_DiseaseCode> classification = dbContext.CID_DiseaseCodes.ToList();

            diagnosis.SaveDiagnosis(classification);
            int end = dbContext.Diagnoses.ToList().Count;

            //assert
            test = extentReport.StartTest("Save Diagnosis", "Insert three new CID CODES, diagnosi size increased by three end > start");
            Assert.Greater(end, start);
            Console.WriteLine("Save diagnosis");
        }
Пример #5
0
        public void SaveEmptyListOfCID()
        { //arrange
            impDiagnosis diagnosis = new impDiagnosis(dbContext);
            //act
            int start = dbContext.Diagnoses.ToList().Count;
            List <CID_DiseaseCode> classification = new List <CID_DiseaseCode>();

            diagnosis.SaveDiagnosis(classification);
            int end = dbContext.Diagnoses.ToList().Count;

            //assert
            test = extentReport.StartTest("Save empty Diagnosis", "should fail because the list is empty end == start");
            Assert.Greater(end, start);

            Console.WriteLine("testing null instance");
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DiagnosisController"/> class.
 /// </summary>
 public DiagnosisController()
 {
     impDiagnosis = new impDiagnosis(db);
     db.Configuration.ProxyCreationEnabled = false;
 }