Beispiel #1
0
        public void TestAddingDuplicatePatient()
        {
            Patient tempPatient = new Patient();

            tempPatient.PatientOQ        = "123451";
            tempPatient.PatientFirstName = "Test";
            tempPatient.PatientLastName  = "McGee";
            tempPatient.RelationToHead   = "Related";
            tempPatient.PatientGender    = "Female";
            tempPatient.PatientEthnicity = "Pacific Islander";
            tempPatient.PatientAgeGroup  = "12-17";
            tempPatient.IsHead           = false;

            //	Premade household
            PatientHousehold tempHousehold = new PatientHousehold();

            tempHousehold.HouseholdCounty        = "Box Elder";
            tempHousehold.HouseholdIncomeBracket = "$25,000-34,999";
            tempHousehold.HouseholdPopulation    = 7;

            //	Add the patient with new household
            Test_Patient tpat = OpenTestPatient();

            DeletePatient(tpat, tempPatient.PatientOQ);
            AddPatient(tpat, tempPatient, tempHousehold);

            //	Open the client window
            Window_Client window = OpenCreateNewPatient();

            //	Add the patient
            UIUtilities.ClickOnItem(window.check_HeadOfHousehold);

            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, tempPatient.PatientOQ);
            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, tempPatient.PatientFirstName);
            UIUtilities.TypeIntoTextbox(window.textbox_LastName, tempPatient.PatientLastName);

            UIUtilities.SelectComboboxItem(window.combobox_AgeGroup, tempPatient.PatientAgeGroup);
            UIUtilities.SelectComboboxItem(window.combobox_ethnicity, tempPatient.PatientEthnicity);
            UIUtilities.SelectComboboxItem(window.combobox_Gender, tempPatient.PatientGender);

            //	Check that it added
            UIUtilities.ClickOnItemNoWait(window.button_AddUpdateClient);

            UIUtilities.CloseWindow(tpat);

            ThreadUtilities.RunOnUIThread(new Action(() =>
            {
                //	Is the window still open after clicking, because the error dialog should be showing
                if (Application.Current.Windows.Count == 0)
                {
                    Assert.Fail("The window closed down when it should have stayed open after adding a duplicate Patient OQ.");
                }
            }));

            UIUtilities.CloseWindow(window);
        }
Beispiel #2
0
        public void TestNumberOnlyInput()
        {
            Window_Client window = OpenCreateNewPatient();

            //	Household Pop
            UIUtilities.ClickOnItem(window.check_FirstHouseholdMember);

            UIUtilities.TypeIntoTextboxNoWait(window.textbox_HouseholdPopulation, "123456789abcdefghijklmnopqrstuvwxyz");
            ThreadUtilities.RunOnUIThread(new Action(() =>
            {
                Assert.AreEqual("123456789", window.textbox_HouseholdPopulation.Text);
            }));

            UIUtilities.CloseWindow(window);
        }
Beispiel #3
0
        public void TestUsingWrongFamilyOQForHousehold()
        {
            //	Patient to test with
            Patient tempPatient = new Patient();

            tempPatient.PatientOQ        = "123451";
            tempPatient.PatientFirstName = "Test";
            tempPatient.PatientLastName  = "McGee";
            tempPatient.RelationToHead   = "Related";
            tempPatient.PatientGender    = "Female";
            tempPatient.PatientEthnicity = "Pacific Islander";
            tempPatient.PatientAgeGroup  = "12-17";
            tempPatient.IsHead           = false;

            //	Add the temp patient manually, but link to previously-made family member
            Window_Client window = OpenCreateNewPatient();

            UIUtilities.TypeIntoTextbox(window.textbox_FamilyMemberOQ, "01234567");

            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, tempPatient.PatientOQ);
            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, tempPatient.PatientFirstName);
            UIUtilities.TypeIntoTextbox(window.textbox_LastName, tempPatient.PatientLastName);
            UIUtilities.TypeIntoTextbox(window.textbox_RelationToHead, tempPatient.RelationToHead);

            UIUtilities.SelectComboboxItem(window.combobox_AgeGroup, tempPatient.PatientAgeGroup);
            UIUtilities.SelectComboboxItem(window.combobox_ethnicity, tempPatient.PatientEthnicity);
            UIUtilities.SelectComboboxItem(window.combobox_Gender, tempPatient.PatientGender);

            UIUtilities.ClickOnItem(window.button_AddUpdateClient);

            ThreadUtilities.RunOnUIThread(new Action(() =>
            {
                //	Is the window still open after clicking, because the error dialog should be showing
                if (Application.Current.Windows.Count == 0)
                {
                    Assert.Fail("The window closed down when it should have stayed open after adding a wrong family OQ.");
                }
            }));

            UIUtilities.CloseWindow(window);
        }
Beispiel #4
0
        public void TestAddingNewHousehold()
        {
            Patient tempPatient = new Patient();

            tempPatient.PatientOQ        = "123451";
            tempPatient.PatientFirstName = "Test";
            tempPatient.PatientLastName  = "McGee";
            tempPatient.RelationToHead   = "Related";
            tempPatient.PatientGender    = "Female";
            tempPatient.PatientEthnicity = "Pacific Islander";
            tempPatient.PatientAgeGroup  = "12-17";
            tempPatient.IsHead           = false;

            //	Premade household
            PatientHousehold tempHousehold = new PatientHousehold();

            tempHousehold.HouseholdCounty        = "Box Elder";
            tempHousehold.HouseholdIncomeBracket = "$25,000-34,999";
            tempHousehold.HouseholdPopulation    = 7;

            //	Add the patient with new household
            Test_Patient tpat = OpenTestPatient();

            DeletePatient(tpat, tempPatient.PatientOQ);

            //	Open the client window
            Window_Client window = OpenCreateNewPatient();

            //	Add the patient
            UIUtilities.ClickOnItem(window.check_HeadOfHousehold);

            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, tempPatient.PatientOQ);
            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, tempPatient.PatientFirstName);
            UIUtilities.TypeIntoTextbox(window.textbox_LastName, tempPatient.PatientLastName);

            UIUtilities.SelectComboboxItem(window.combobox_AgeGroup, tempPatient.PatientAgeGroup);
            UIUtilities.SelectComboboxItem(window.combobox_ethnicity, tempPatient.PatientEthnicity);
            UIUtilities.SelectComboboxItem(window.combobox_Gender, tempPatient.PatientGender);

            //	Add the household
            UIUtilities.ClickOnItem(window.check_FirstHouseholdMember);

            UIUtilities.TypeIntoTextbox(window.textbox_HouseholdPopulation, tempHousehold.HouseholdPopulation.ToString());
            UIUtilities.SelectComboboxItem(window.combobox_County, tempHousehold.HouseholdCounty);
            UIUtilities.SelectComboboxItem(window.combobox_IncomeBracket, tempHousehold.HouseholdIncomeBracket);

            //	Check that it added
            UIUtilities.ClickOnItemNoWait(window.button_AddUpdateClient);

            //	Find the patient
            FindPatient(tpat, tempPatient.PatientOQ);

            //	Check the values
            ThreadUtilities.RunOnUIThread(new Action(() =>
            {
                Assert.AreEqual(tempHousehold.HouseholdCounty, tpat.text_county.Text);
                Assert.AreEqual(tempHousehold.HouseholdIncomeBracket, tpat.text_Income.Text);
                Assert.AreEqual(tempHousehold.HouseholdPopulation, int.Parse(tpat.text_HouseholdPop.Text));
            }));

            UIUtilities.CloseWindow(tpat);
        }
Beispiel #5
0
        public void TestButtonDisable()
        {
            Patient tempPatient = new Patient();

            tempPatient.PatientOQ        = "1234567890";
            tempPatient.PatientFirstName = "Test";
            tempPatient.PatientLastName  = "McGee";
            tempPatient.RelationToHead   = "Related";
            tempPatient.PatientGender    = "Female";
            tempPatient.PatientEthnicity = "Pacific Islander";
            tempPatient.PatientAgeGroup  = "12-17";
            tempPatient.IsHead           = false;

            Window_Client window = OpenCreateNewPatient();

            //	Check that the button is initially disabled
            CheckAddPatientButtonState(window, false);

            //	Type into all other entry points, so the button is enabled
            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, tempPatient.PatientOQ);
            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, tempPatient.PatientFirstName);
            UIUtilities.TypeIntoTextbox(window.textbox_LastName, tempPatient.PatientLastName);
            UIUtilities.TypeIntoTextbox(window.textbox_RelationToHead, tempPatient.RelationToHead);
            UIUtilities.TypeIntoTextbox(window.textbox_FamilyMemberOQ, "1234560");

            CheckAddPatientButtonState(window, true);

            //	Remove one value at a time from the textboxes
            //	Client OQ
            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, "");
            CheckAddPatientButtonState(window, false);

            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, tempPatient.PatientOQ);

            //	First Name
            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, "");
            CheckAddPatientButtonState(window, false);

            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, tempPatient.PatientFirstName);

            //	Last Name
            UIUtilities.TypeIntoTextbox(window.textbox_LastName, "");
            CheckAddPatientButtonState(window, false);

            UIUtilities.TypeIntoTextbox(window.textbox_LastName, tempPatient.PatientLastName);

            //	Relation
            UIUtilities.TypeIntoTextbox(window.textbox_RelationToHead, "");
            CheckAddPatientButtonState(window, false);

            UIUtilities.TypeIntoTextbox(window.textbox_RelationToHead, tempPatient.RelationToHead);

            //	Family OQ
            UIUtilities.TypeIntoTextbox(window.textbox_FamilyMemberOQ, "");
            CheckAddPatientButtonState(window, false);

            UIUtilities.TypeIntoTextbox(window.textbox_FamilyMemberOQ, "1234560");

            //	Clear Head of House, then Check the checkbox
            UIUtilities.TypeIntoTextbox(window.textbox_RelationToHead, "");

            UIUtilities.ClickOnItem(window.check_HeadOfHousehold);
            CheckAddPatientButtonState(window, true);

            //	Clear family relation, then Check the checkbox
            UIUtilities.TypeIntoTextbox(window.textbox_FamilyMemberOQ, "");

            UIUtilities.ClickOnItem(window.check_FirstHouseholdMember);
            CheckAddPatientButtonState(window, true);

            //	With the new household selected, test the textbox
            UIUtilities.TypeIntoTextbox(window.textbox_HouseholdPopulation, "");
            CheckAddPatientButtonState(window, false);

            UIUtilities.CloseWindow(window);
        }
Beispiel #6
0
        public void TestAddingPatient()
        {
            //	Set the testing data
            Patient tempPatient = new Patient();

            tempPatient.PatientOQ        = "123451";
            tempPatient.PatientFirstName = "Test";
            tempPatient.PatientLastName  = "McGee";
            tempPatient.RelationToHead   = "Related";
            tempPatient.PatientGender    = "Female";
            tempPatient.PatientEthnicity = "Pacific Islander";
            tempPatient.PatientAgeGroup  = "12-17";
            tempPatient.IsHead           = false;

            //	TODO: Need to check the patient problems


            Test_Patient tpat = OpenTestPatient();

            DeletePatient(tpat, tempPatient.PatientOQ);

            Window_Client window = OpenCreateNewPatient();

            UIUtilities.ClickOnItem(window.check_FirstHouseholdMember);

            //	Input the data for the comboboxes
            UIUtilities.TypeIntoTextbox(window.textbox_ClientOQ, tempPatient.PatientOQ);
            UIUtilities.TypeIntoTextbox(window.textbox_FirstName, tempPatient.PatientFirstName);
            UIUtilities.TypeIntoTextbox(window.textbox_LastName, tempPatient.PatientLastName);
            UIUtilities.TypeIntoTextbox(window.textbox_RelationToHead, tempPatient.RelationToHead);

            UIUtilities.SelectComboboxItem(window.combobox_AgeGroup, tempPatient.PatientAgeGroup);
            UIUtilities.SelectComboboxItem(window.combobox_ethnicity, tempPatient.PatientEthnicity);
            UIUtilities.SelectComboboxItem(window.combobox_Gender, tempPatient.PatientGender);

            UIUtilities.ClickOnItemNoWait(window.button_AddUpdateClient);

            //	Find the added patient
            FindPatient(tpat, tempPatient.PatientOQ);

            //	Add new test patient
            Patient newPatient = new Patient();

            ThreadUtilities.RunOnUIThread(new Action(() =>
            {
                newPatient.PatientOQ        = tpat.text_PatientOQ.Text;
                newPatient.PatientLastName  = tpat.text_LastName.Text;
                newPatient.PatientFirstName = tpat.text_FirstName.Text;
                newPatient.RelationToHead   = tpat.text_RelationToHEad.Text;
                newPatient.PatientEthnicity = tpat.text_Ethnicity.Text;
                newPatient.PatientAgeGroup  = tpat.text_AgeGroup.Text;
                newPatient.PatientGender    = tpat.text_Gender.Text;
            }));

            ThreadUtilities.RunOnUIThread(new Action(() =>
            {
                Assert.AreEqual(tempPatient.PatientOQ, newPatient.PatientOQ);
                Assert.AreEqual(tempPatient.PatientFirstName, newPatient.PatientFirstName);
                Assert.AreEqual(tempPatient.PatientLastName, newPatient.PatientLastName);
                Assert.AreEqual(tempPatient.RelationToHead, newPatient.RelationToHead);
                Assert.AreEqual(tempPatient.IsHead, newPatient.IsHead);
                Assert.AreEqual(tempPatient.PatientEthnicity, newPatient.PatientEthnicity);
                Assert.AreEqual(tempPatient.PatientAgeGroup, newPatient.PatientAgeGroup);
                Assert.AreEqual(tempPatient.PatientGender, newPatient.PatientGender);
            }));

            DeletePatient(tpat, tempPatient.PatientOQ);

            UIUtilities.CloseWindow(tpat);
        }