public void PhoneResultLog_Post_InValid_Bilirubiun_Range_Low_Should_Fail() { // Arrange var myController = new PhoneResultLogController(); //Call backend to technicians TechnicianBackend TechnicianData = TechnicianBackend.Instance; List <TechnicianModel> tech = TechnicianData.Index(); //Call backend to phones PhoneBackend PhoneData = PhoneBackend.Instance; List <PhoneModel> phone = PhoneData.Index(); //Call backend to clinics ClinicBackend ClinicData = ClinicBackend.Instance; List <ClinicModel> clinic = ClinicData.Index(); var myData = new ResultLogModel { ClinicID = clinic[0].ID, PhoneID = phone[0].ID, UserID = tech[0].ID, BilirubinValue = -1 }; // Act var result = myController.Post(myData); // Reset // Assert Assert.AreEqual(0, result.Status); }
public void Clinic_SetDataSourceSet_Data_Local_Should_Pass() { // Arrange var myBackend = ClinicBackend.Instance; var dataOriginal = myBackend.Index().FirstOrDefault(); // Act ClinicBackend.SetDataSourceDataSet(DataSourceDataSetEnum.Default); // Reset BiliWeb.Backend.DataSourceBackend.Instance.Reset(); // Assert Assert.IsTrue(true); }
public void Clinic_SetDataSource_Data_Local_Should_Pass() { // Arrange var myBackend = ClinicBackend.Instance; var dataOriginal = myBackend.Index().FirstOrDefault(); // Act ClinicBackend.SetDataSource(DataSourceEnum.Local); var result = ClinicBackend.Instance.GetDataSourceString(); // Reset BiliWeb.Backend.DataSourceBackend.Instance.Reset(); // Return Data Source to Mock ClinicBackend.SetDataSource(DataSourceEnum.Mock); // Assert Assert.AreEqual("Store", result); }
public void PhoneResultLog_Post_Valid_ResultLog_Should_Pass() { // Arrange var myController = new PhoneResultLogController(); //Call backend to technicians TechnicianBackend TechnicianData = TechnicianBackend.Instance; List <TechnicianModel> tech = TechnicianData.Index(); //Call backend to phones PhoneBackend PhoneData = PhoneBackend.Instance; List <PhoneModel> phone = PhoneData.Index(); //Call backend to clinics ClinicBackend ClinicData = ClinicBackend.Instance; List <ClinicModel> clinic = ClinicData.Index(); var myData = new ResultLogModel { ClinicID = clinic[0].ID, PhoneID = phone[0].ID, UserID = tech[0].ID, BilirubinValue = 15 }; // Act var result = myController.Post(myData); // Access the Record to ensure it was created var myNewLog = BiliWeb.Backend.DataSourceBackend.Instance.ResultLogBackend.Read(myData.ID); // Reset BiliWeb.Backend.DataSourceBackend.Instance.Reset(); // Assert Assert.AreEqual(1, result.Status); Assert.AreEqual(myData.ID, myNewLog.ID); Assert.AreEqual(myData.BilirubinValue, myNewLog.BilirubinValue); }