/// <summary> /// Tests proper execution when one tool is updated successfully but the other is not. /// </summary> private void TestOneSuccessOneFailure() { var messageDlg = FormatInstallSummaryMessageDlg(false, true); Assert.AreEqual( TextUtil.LineSeparate( Resources.ToolUpdatesDlg_DisplayInstallSummary_Successfully_updated_the_following_tool, string.Empty, SAMPLE_TOOL.PackageName, string.Empty, Resources.ToolUpdatesDlg_DisplayInstallSummary_Failed_to_update_the_following_tool, string.Empty, ToolUpdatesDlg.FormatFailureMessage(NESTED_TOOL_A.PackageName, Resources.ToolUpdatesDlg_InstallUpdates_User_cancelled_installation)), messageDlg.Message); OkDialog(messageDlg, messageDlg.OkDialog); WaitForClosedForm <ToolUpdatesDlg>(); AssertUpdateAvailability(Settings.Default.ToolList, false, true); Settings.Default.ToolList.Clear(); }
/// <summary> /// Test for failing to update a tool due to a ToolExecutionException during installation. /// </summary> private static void TestUpdateFailureMessageException() { Settings.Default.ToolList.Add(SAMPLE_TOOL); var toolUpdatesDlg = FormatToolUpdatesDlg(true, FormatUpdateHelper(FormatToolStoreClient(true), CreateTestInstallFunction(new ToolExecutionException(EXCEPTION_MESSAGE), false)), false); var messageDlg = ShowDialog <MessageDlg>(toolUpdatesDlg.OkDialog); Assert.AreEqual( TextUtil.LineSeparate( Resources.ToolUpdatesDlg_DisplayInstallSummary_Failed_to_update_the_following_tool, string.Empty, ToolUpdatesDlg.FormatFailureMessage(SAMPLE_TOOL.PackageName, EXCEPTION_MESSAGE)), messageDlg.Message); OkDialog(messageDlg, messageDlg.OkDialog); WaitForClosedForm(toolUpdatesDlg); Settings.Default.ToolList.Clear(); }