public void SetAllControllersToAutoMode_ShouldDelegateToInformationProviderWithAuto() { GenericPlcViewModel viewModel = CreateGenericPlcViewModel(_randomModule); viewModel.SetAllControllersToAutoMode(); _informationProvider.Verify(i => i.SetAllControllersToMode(_randomModule, Controller.Mode.Auto)); }
public void SetAllControllersToAutoMode_OnThrowingProvider_ShouldDisplayErrorView() { string randomError = CreateRandom.String(); _informationProvider.Setup(p => p.SetAllControllersToMode(It.IsAny <string>(), It.IsAny <Controller.Mode>())) .Throws(new InvalidOperationException(randomError)); GenericPlcViewModel viewModel = CreateGenericPlcViewModel(); viewModel.SetAllControllersToAutoMode(); _states.Verify(s => s.ChangeToErrorState(It.Is <string>(e => e.Contains(randomError)))); }