private void EditExchangeEmailAccountDialog(MockEditEmailAccountView editEmailAccountView) { var editEmailAccountViewModel = ViewHelper.GetViewModel <EditEmailAccountViewModel>(editEmailAccountView) !; // Get the first page of the wizard var basicEmailAccountView = (MockBasicEmailAccountView)editEmailAccountViewModel.ContentView; var basicEmailAccountViewModel = ViewHelper.GetViewModel <BasicEmailAccountViewModel>(basicEmailAccountView) !; // Select an Exchange account and call the next command basicEmailAccountViewModel.IsExchangeChecked = true; editEmailAccountViewModel.NextCommand.Execute(null); // We are now on the Exchange settings page Assert.IsInstanceOfType(editEmailAccountViewModel.ContentView, typeof(MockExchangeSettingsView)); Assert.IsTrue(editEmailAccountViewModel.IsLastPage); // Go back to the first page and then call the next command twice editEmailAccountViewModel.BackCommand.Execute(null); Assert.IsFalse(editEmailAccountViewModel.IsLastPage); editEmailAccountViewModel.NextCommand.Execute(null); editEmailAccountViewModel.NextCommand.Execute(null); // The wizard is finished Assert.IsFalse(editEmailAccountView.IsVisible); }
private void EditExchangeEmailAccountDialog(MockEditEmailAccountView editEmailAccountView) { var editEmailAccountViewModel = ViewHelper.GetViewModel<EditEmailAccountViewModel>(editEmailAccountView); // Get the first page of the wizard var basicEmailAccountView = (MockBasicEmailAccountView)editEmailAccountViewModel.ContentView; var basicEmailAccountViewModel = ViewHelper.GetViewModel<BasicEmailAccountViewModel>(basicEmailAccountView); // Select an Exchange account and call the next command basicEmailAccountViewModel.IsExchangeChecked= true; editEmailAccountViewModel.NextCommand.Execute(null); // We are now on the Exchange settings page Assert.IsInstanceOfType(editEmailAccountViewModel.ContentView, typeof(MockExchangeSettingsView)); Assert.IsTrue(editEmailAccountViewModel.IsLastPage); // Go back to the first page and then call the next command twice editEmailAccountViewModel.BackCommand.Execute(null); Assert.IsFalse(editEmailAccountViewModel.IsLastPage); editEmailAccountViewModel.NextCommand.Execute(null); editEmailAccountViewModel.NextCommand.Execute(null); // The wizard is finished Assert.IsFalse(editEmailAccountView.IsVisible); }
private void EditEmailAccountViewShowDialog(MockEditEmailAccountView view) { var viewModel = ViewHelper.GetViewModel<EditEmailAccountViewModel>(view); // Just finish the wizard with default settings viewModel.NextCommand.Execute(null); viewModel.NextCommand.Execute(null); }
private static void EditEmailAccountViewShowDialog(MockEditEmailAccountView view) { var viewModel = ViewHelper.GetViewModel <EditEmailAccountViewModel>(view); // Just finish the wizard with default settings viewModel.NextCommand.Execute(null); viewModel.NextCommand.Execute(null); }
private void EditPop3EmailAccountDialog(MockEditEmailAccountView editEmailAccountView) { var editEmailAccountViewModel = ViewHelper.GetViewModel<EditEmailAccountViewModel>(editEmailAccountView); // Get the first page of the wizard var basicEmailAccountView = (MockBasicEmailAccountView)editEmailAccountViewModel.ContentView; var basicEmailAccountViewModel = ViewHelper.GetViewModel<BasicEmailAccountViewModel>(basicEmailAccountView); // We are on the first page thus it is not possible to go back Assert.IsFalse(editEmailAccountViewModel.BackCommand.CanExecute(null)); Assert.IsFalse(editEmailAccountViewModel.IsLastPage); // Simulate that a validation error occurred. We are not allowed to click on next. AssertHelper.CanExecuteChangedEvent(editEmailAccountViewModel.NextCommand, () => editEmailAccountViewModel.IsValid = false); Assert.IsFalse(editEmailAccountViewModel.NextCommand.CanExecute(null)); // Select a Pop3 account and call the next command editEmailAccountViewModel.IsValid = true; basicEmailAccountViewModel.IsPop3Checked = true; editEmailAccountViewModel.NextCommand.Execute(null); // We are now on the Pop3 settings page; call the back command Assert.IsInstanceOfType(editEmailAccountViewModel.ContentView, typeof(MockPop3SettingsView)); Assert.IsTrue(editEmailAccountViewModel.IsLastPage); AssertHelper.CanExecuteChangedEvent(editEmailAccountViewModel.BackCommand, () => editEmailAccountViewModel.BackCommand.Execute(null)); // We are back on the first page; call the next command Assert.AreEqual(basicEmailAccountView, editEmailAccountViewModel.ContentView); Assert.IsFalse(editEmailAccountViewModel.IsLastPage); AssertHelper.CanExecuteChangedEvent(editEmailAccountViewModel.BackCommand, () => editEmailAccountViewModel.NextCommand.Execute(null)); // We are now again on the Pop3 settings page; call the next command Assert.IsInstanceOfType(editEmailAccountViewModel.ContentView, typeof(MockPop3SettingsView)); editEmailAccountViewModel.NextCommand.Execute(null); // The wizard is finished Assert.IsFalse(editEmailAccountView.IsVisible); }
private void EditPop3EmailAccountDialog(MockEditEmailAccountView editEmailAccountView) { var editEmailAccountViewModel = ViewHelper.GetViewModel <EditEmailAccountViewModel>(editEmailAccountView); // Get the first page of the wizard var basicEmailAccountView = (MockBasicEmailAccountView)editEmailAccountViewModel.ContentView; var basicEmailAccountViewModel = ViewHelper.GetViewModel <BasicEmailAccountViewModel>(basicEmailAccountView); // We are on the first page thus it is not possible to go back Assert.IsFalse(editEmailAccountViewModel.BackCommand.CanExecute(null)); Assert.IsFalse(editEmailAccountViewModel.IsLastPage); // Simulate that a validation error occurred. We are not allowed to click on next. AssertHelper.CanExecuteChangedEvent(editEmailAccountViewModel.NextCommand, () => editEmailAccountViewModel.IsValid = false); Assert.IsFalse(editEmailAccountViewModel.NextCommand.CanExecute(null)); // Select a Pop3 account and call the next command editEmailAccountViewModel.IsValid = true; basicEmailAccountViewModel.IsPop3Checked = true; editEmailAccountViewModel.NextCommand.Execute(null); // We are now on the Pop3 settings page; call the back command Assert.IsInstanceOfType(editEmailAccountViewModel.ContentView, typeof(MockPop3SettingsView)); Assert.IsTrue(editEmailAccountViewModel.IsLastPage); AssertHelper.CanExecuteChangedEvent(editEmailAccountViewModel.BackCommand, () => editEmailAccountViewModel.BackCommand.Execute(null)); // We are back on the first page; call the next command Assert.AreEqual(basicEmailAccountView, editEmailAccountViewModel.ContentView); Assert.IsFalse(editEmailAccountViewModel.IsLastPage); AssertHelper.CanExecuteChangedEvent(editEmailAccountViewModel.BackCommand, () => editEmailAccountViewModel.NextCommand.Execute(null)); // We are now again on the Pop3 settings page; call the next command Assert.IsInstanceOfType(editEmailAccountViewModel.ContentView, typeof(MockPop3SettingsView)); editEmailAccountViewModel.NextCommand.Execute(null); // The wizard is finished Assert.IsFalse(editEmailAccountView.IsVisible); }