Ejemplo n.º 1
0
        public void TraditionalSwitchWithoutConstraintTest(bool initialState,
                                                           Lightswitch.ALightSwitch.State expected)
        {
            TraditionalLightSwitch testSwitch = new TraditionalLightSwitch("Traditional Switch", initialState);

            testSwitch.ToggleSwitch();

            Assert.Equal(expected, testSwitch.CurrentState);
        }
Ejemplo n.º 2
0
        public void TraditionalSwitchWithConstraintTest(bool initialState, string testTime, ALightSwitch.State expected)
        {
            TraditionalLightSwitch testSwitch = new TraditionalLightSwitch("Traditinal Switch", initialState, true);
            TimeSpan time = TimeSpan.Parse(testTime);

            testSwitch.SetTimeOfDay(time);
            testSwitch.ToggleSwitch();

            Assert.Equal(expected, testSwitch.CurrentState);
        }