Exemple #1
0
        public void SamsungRemoteControlTest01()
        {
            // 三星电视机
            var tv = new SamsungTV();
            // 创建一个遥控器
            BaseRemoteControl control = new ConcreteRemote(tv);

            control.On();
            Assert.AreEqual("三星牌电视机已经打开了", control.GetQueueStatus());

            control.Off();
            Assert.AreEqual("三星牌电视机已经关闭了", control.GetQueueStatus());

            control.SetChannel();
            Assert.AreEqual("延迟2秒 -> 三星牌电视机换台(小窗口显示)", control.GetQueueStatus());
        }
Exemple #2
0
        public void ChangHongRemoteControlTest01()
        {
            // 长虹电视机
            var tv = new ChangHongTV();
            // 创建一个遥控器
            BaseRemoteControl control = new ConcreteRemote(tv);

            control.On();
            Assert.AreEqual("长虹牌电视机已经打开了", control.GetQueueStatus());

            control.Off();
            Assert.AreEqual("长虹牌电视机已经关闭了", control.GetQueueStatus());

            control.SetChannel();
            Assert.AreEqual("延迟2秒 -> 长虹牌电视机换台", control.GetQueueStatus());
        }