Exemplo n.º 1
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());
        }
Exemplo n.º 2
0
 public void OneButtonRemoteLightOnTest()
 {
     OneButtonRemote remote = new OneButtonRemote();
     ILight light = MockRepository.GenerateMock<ILight>();
     LightOnCommand command = new LightOnCommand(light);
     remote.SetCommand(command);
     remote.PushButton();
     light.AssertWasCalled(x => x.On());
 }