Exemplo n.º 1
0
        public void ABCCreationTest()
        {
            ABC abc = new ABC(2, "cons", true, "air", "breath", 10, "circ", 15);

            Assert.AreEqual(abc.getConsciousness(), "cons");
            Assert.AreEqual(abc.getDisoriented(), true);
            Assert.AreEqual(abc.getAirways(), "air");
            Assert.AreEqual(abc.getBreathing(), "breath");
            Assert.AreEqual(abc.getBreathingFrequency(), 10);
            Assert.AreEqual(abc.getCirculation(), "circ");
            Assert.AreEqual(abc.getCirculationFrequency(), 15);
        }
Exemplo n.º 2
0
        public void DefaultABCCreationTest()
        {
            ABC abc = new ABC();

            Assert.AreEqual(abc.getConsciousness(), "notSet");
            Assert.AreEqual(abc.getDisoriented(), false);
            Assert.AreEqual(abc.getAirways(), "notSet");
            Assert.AreEqual(abc.getBreathing(), "notSet");
            Assert.AreEqual(abc.getBreathingFrequency(), -1);
            Assert.AreEqual(abc.getCirculation(), "notSet");
            Assert.AreEqual(abc.getCirculationFrequency(), -1);
        }
Exemplo n.º 3
0
        public void getterSetterTest()
        {
            ABC abc = new ABC();

            abc.setConsciousness("set");
            Assert.AreEqual(abc.getConsciousness(), "set");
            abc.setDisoriented(true);
            Assert.AreEqual(abc.getDisoriented(), true);
            abc.setAirways("set");
            Assert.AreEqual(abc.getAirways(), "set");
            abc.setBreathing("set");
            Assert.AreEqual(abc.getBreathing(), "set");
            abc.setBreathingFrequency(5);
            Assert.AreEqual(abc.getBreathingFrequency(), 5);
            abc.setCirculation("set");
            Assert.AreEqual(abc.getCirculation(), "set");
            abc.setCirculationFrequency(55);
            Assert.AreEqual(abc.getCirculationFrequency(), 55);
        }
        //Set up default values
        public void FillForm(ABC abc)
        {
            String consciousness = abc.getConsciousness();

            switch (consciousness)
            {
            case "Alert": ConsciousnessBox.SelectedIndex = 0;
                break;

            case "Verbal": ConsciousnessBox.SelectedIndex = 1;
                break;

            case "Painful": ConsciousnessBox.SelectedIndex = 2;
                break;

            case "Unconscious": ConsciousnessBox.SelectedIndex = 3;
                break;

            default: ConsciousnessBox.SelectedIndex = -1;
                break;
            }

            Disoriented.IsChecked = abc.getDisoriented();

            String airways = abc.getAirways();

            switch (airways)
            {
            case "Clear": AirwaysBox.SelectedIndex = 0;
                break;

            case "Partially Obstructed": AirwaysBox.SelectedIndex = 1;
                break;

            case "Completely Obstructed": AirwaysBox.SelectedIndex = 2;
                break;

            default: AirwaysBox.SelectedIndex = -1;
                break;
            }

            String breathing = abc.getBreathing();

            switch (breathing)
            {
            case "Normal": BreathingBox.SelectedIndex = 0;
                break;

            case "Difficulty": BreathingBox.SelectedIndex = 1;
                break;

            case "Absent": BreathingBox.SelectedIndex = 2;
                break;

            default: BreathingBox.SelectedIndex = -1;
                break;
            }

            BreathingFrequency.Text = (abc.getBreathingFrequency() >= 0) ? abc.getBreathingFrequency().ToString() : "";

            String circulation = abc.getCirculation();

            switch (circulation)
            {
            case "Normal": CirculationBox.SelectedIndex = 0;
                break;

            case "Chest Pain": CirculationBox.SelectedIndex = 1;
                break;

            case "Hemorrhage": CirculationBox.SelectedIndex = 2;
                break;

            case "No Pulse": CirculationBox.SelectedIndex = 3;
                break;

            default: CirculationBox.SelectedIndex = -1;
                break;
            }
            CirculationFrequency.Text = (abc.getCirculationFrequency() >= 0) ? abc.getCirculationFrequency().ToString() : "";
        }