Esempio n. 1
0
        public void TestMethod05()
        {
            LightAdapter light    = new LightAdapter();
            MySwitch     mySwitch = new MySwitch(light);

            mySwitch.SwitchOn();
            Assert.AreEqual(1, light.GetState());
            mySwitch.SwitchOff();
            Assert.AreEqual(0, light.GetState());
            mySwitch.SwitchOn();
            Assert.AreEqual(1, light.GetState());
        }
        public void TestMethod04()
        {
            ISwitchAble light    = new Light();
            MySwitch    mySwitch = new MySwitch(light);

            mySwitch.SwitchOn();
            Assert.AreEqual(1, light.GetState());
            mySwitch.SwitchOff();
            Assert.AreEqual(0, light.GetState());
            mySwitch.SwitchOn();
            Assert.AreEqual(1, light.GetState());
        }