public static void Test5MacroCommand()
        {
            var livingRoomLight = new Light("living room");
            var stereo          = new Stereo("living room");
            var fan             = new CeilingFan("living room");

            var lightOnCmd = new LightOnCommand(livingRoomLight);
            var steroOnCmd = new StereoOnWithCDCommand(stereo);
            var fanHighCmd = new CeilingFanHighCommand(fan);

            var lightOffCmd  = new LightOffCommand(livingRoomLight);
            var stereoOffCmd = new StereoOffCommand(stereo);
            var fanOffCmd    = new CeilingFanOffCommand(fan);

            var partyOnCmd  = new MacroCommand(new Command[] { lightOnCmd, steroOnCmd, fanHighCmd });
            var partyOffCmd = new MacroCommand(new Command[] { lightOffCmd, stereoOffCmd, fanOffCmd });

            var remote = new RemoteControl();

            remote.SetCommand(0, partyOnCmd, partyOffCmd);

            Console.WriteLine(remote.ToString());
            remote.OnButtonPushed(0);
            remote.OffButtonPushed(0);
        }
        public static void Test4CeilingFan()
        {
            var remote              = new RemoteControl();
            var ceilingFan          = new CeilingFan("Living room");
            var ceilingFanHighCmd   = new CeilingFanHighCommand(ceilingFan);
            var ceilingFanMediumCmd = new CeilingFanMediumCommand(ceilingFan);
            var ceilingFanOffCmd    = new CeilingFanOffCommand(ceilingFan);

            remote.SetCommand(0, ceilingFanMediumCmd, ceilingFanOffCmd);
            remote.SetCommand(1, ceilingFanHighCmd, ceilingFanOffCmd);

            Console.WriteLine(remote.ToString());
            remote.OnButtonPushed(0);
            remote.OffButtonPushed(0);
            remote.UndoButtonPushed();

            remote.OnButtonPushed(1);
            remote.UndoButtonPushed();
        }