示例#1
0
        public void LightOnCommandTest()
        {
            ILight         light   = MockRepository.GenerateMock <ILight>();
            LightOnCommand command = new LightOnCommand(light);

            command.Execute();
            light.AssertWasCalled(x => x.On());
        }
示例#2
0
        public void OneButtonRemoteLightOffTest()
        {
            OneButtonRemote remote  = new OneButtonRemote();
            ILight          light   = MockRepository.GenerateMock <ILight>();
            LightOffCommand command = new LightOffCommand(light);

            remote.SetCommand(command);
            remote.PushButton();
            light.AssertWasCalled(x => x.Off());
        }