public static void Test2()
        {
            var remote          = new RemoteControl();
            var livingRoomLight = new Light("Living room");
            var kitchenLight    = new Light("Kitchen");
            var stereo          = new Stereo("Living room");

            var livingRoomLightOnCommand  = new LightOnCommand(livingRoomLight);
            var livingRoomLightOffCommand = new LightOffCommand(livingRoomLight);
            var kitchenLightOnCommand     = new LightOnCommand(kitchenLight);
            var kitchenLightOffCommand    = new LightOffCommand(kitchenLight);

            var stereoOnWithCDCommand = new StereoOnWithCDCommand(stereo);
            var stereoOffCommand      = new StereoOffCommand(stereo);

            remote.SetCommand(0, livingRoomLightOnCommand, livingRoomLightOffCommand);
            remote.SetCommand(1, kitchenLightOnCommand, kitchenLightOffCommand);
            remote.SetCommand(2, stereoOnWithCDCommand, stereoOffCommand);

            Console.WriteLine(remote.ToString());

            remote.OnButtonPushed(0);
            remote.OffButtonPushed(0);
            remote.OnButtonPushed(1);
            remote.OffButtonPushed(1);
            remote.OnButtonPushed(2);
            remote.OffButtonPushed(2);
            remote.OffButtonPushed(3);
        }
        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 StereoOnWithCDCommand(Stereo stereo)
 {
     Stereo = stereo;
 }