Exemplo n.º 1
0
        public void US6_When_button_pressed_and_door_closed_and_heating_increase_time_1_minute(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
        {
            using (var ctx = new MicrowaveTestSetup(ctrl, hw))
            {
                // simulate press start button
                ctx.Ui.PressStartButton();

                Assert.IsTrue(ctx.Hw.HeaterOn,
                              "ensure the heater has been started after 'PressStartButton'");

                SimulateTimeElapse(ctx.Ctrl, 59);

                // simulate second press of the start button
                ctx.Ui.PressStartButton();

                Assert.IsTrue(ctx.Hw.HeaterOn, "ensure the heater is still on");

                SimulateTimeElapse(ctx.Ctrl, 60);

                Assert.IsTrue(ctx.Hw.HeaterOn,
                              "ensure the heater is on 1 second before the end of heating (60 + 59 seconds)");

                SimulateTimeElapse(ctx.Ctrl, 1);

                Assert.IsFalse(ctx.Hw.HeaterOn,
                               "ensure the heater is off when 60 second elapsed");
            }
        }
Exemplo n.º 2
0
 public void US7_When_I_open_the_door_twice(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
 {
     using (var ctx = new MicrowaveTestSetup(ctrl, hw))
     {
         // simulate door open twice - does it make any sense?
         ctx.Ui.OpenDoor();
         ctx.Ui.OpenDoor();
     }
 }
Exemplo n.º 3
0
        public void US1_When_I_open_door_Light_is_on(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
        {
            using (var ctx = new MicrowaveTestSetup(ctrl, hw))
            {
                // simulate door open
                ctx.Ui.OpenDoor();

                Assert.IsTrue(ctx.Hw.LightOn, "ensure the light is on after door closing");
            }
        }
Exemplo n.º 4
0
        public void US2_When_I_close_door_Light_turns_off(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
        {
            using (var ctx = new MicrowaveTestSetup(ctrl, hw))
            {
                // simulate door open
                ctx.Ui.OpenDoor();
                Assert.IsTrue(ctx.Hw.LightOn, "ensure the light is on after door closing");

                // simulate door close
                ctx.Ui.CloseDoor();
                Assert.IsFalse(ctx.Hw.LightOn, "ensure the light is off after door closing");
            }
        }
Exemplo n.º 5
0
        public void US3_When_I_open_door_heater_stops_if_running(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
        {
            using (var ctx = new MicrowaveTestSetup(ctrl, hw))
            {
                // simulate press start button - start heating
                ctx.Ui.PressStartButton();

                Assert.IsTrue(ctx.Hw.HeaterOn, "ensure the heater has been started after 'PressStartButton'");

                // simulate door open
                ctx.Ui.OpenDoor();

                Assert.IsFalse(ctx.Hw.HeaterOn, "ensure the heater has been stopped after opening the door");
                Assert.IsTrue(ctx.Hw.LightOn, "ensure if light is on after opening the door");
            }
        }
Exemplo n.º 6
0
        public void US4_When_I_press_start_button_when_door_is_open_nothing_happens(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
        {
            using (var ctx = new MicrowaveTestSetup(ctrl, hw))
            {
                // simulate door open
                ctx.Ui.OpenDoor();

                Assert.IsTrue(ctx.Hw.DoorOpen, "ensure if door state is correct");
                Assert.IsTrue(ctx.Hw.LightOn, "ensure the light is on");
                Assert.IsFalse(ctx.Hw.HeaterOn, "ensure the heater is off");

                // simulate press start button
                ctx.Ui.PressStartButton();

                Assert.IsFalse(ctx.Hw.HeaterOn, "ensure if heating has not been started after 'PressStartButton'");
            }
        }
Exemplo n.º 7
0
        public void US3_When_I_open_door_heater_stops_if_running_ensure_total_time(IMicrowaveOvenControler ctrl, IMicrowaveOvenHWEx hw)
        {
            using (var ctx = new MicrowaveTestSetup(ctrl, hw))
            {
                // simulate press start button - start heating
                ctx.Ui.PressStartButton();

                Assert.IsTrue(ctx.Hw.HeaterOn, "ensure the heater has been started after 'PressStartButton'");

                // simulate door open
                ctx.Ui.OpenDoor();

                // simulate time elapsed - should not change enything
                SimulateTimeElapse(ctx.Ctrl, 60);

                // simulate door close
                ctx.Ui.CloseDoor();

                SimulateTimeElapse(ctx.Ctrl, 59);

                Assert.IsTrue(ctx.Hw.HeaterOn, "ensure the heater is still running");
                Assert.IsFalse(ctx.Hw.LightOn, "ensure if light is of after closing the door");
            }
        }