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()); }
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()); }