Exemplo n.º 1
0
        public void StatelessSwitchWithoutConstraintTest(bool initialState, ALightSwitch.State expected)
        {
            StatelessLightSwitch testSwitch = new StatelessLightSwitch("Stateless Switch", initialState);

            testSwitch.ToggleSwitch();

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

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

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