コード例 #1
0
        /// <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();
        }