public void ChangeMode_OnControllerInManualMode_ShouldDelgateToCommanderWithAuto() { _innerController.ControllerMode = Controller.Mode.Manual; MasterDetailViewModel viewModel = CreateMasterDetailViewModel(); viewModel.ChangeMode(); _commander.Verify(c => c.SetControllerToMode(_randomModule, _randomController, Controller.Mode.Auto)); }
public void ChangeMode_OnFaultingCommander_ShouldDisplayError() { string randomError = CreateRandom.String(); _commander.Setup(c => c.SetControllerToMode(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <Controller.Mode>())).Throws(new InvalidOperationException(randomError)); MasterDetailViewModel viewModel = CreateMasterDetailViewModel(); viewModel.ChangeMode(); _states.Verify(s => s.ChangeToErrorState(It.Is <string>(e => e.Contains(randomError)))); }