/// <summary> /// Sets the new execution outcome internal. /// </summary> private void SetNewExecutionOutcomeInternal(TestCaseExecutionType testCaseExecutionType) { bool shouldCommentWindowShow = RegistryManager.ReadShouldCommentWindowShow(); string comment = String.Empty; bool isCanceled = false; if (shouldCommentWindowShow && testCaseExecutionType != TestCaseExecutionType.Active) { RegistryManager.WriteTitleTitlePromtDialog(string.Empty); var dialog = new PrompDialogRichTextBoxWindow(); dialog.ShowDialog(); Task t = Task.Factory.StartNew(() => { isCanceled = RegistryManager.GetIsCanceledPromtDialog(); comment = RegistryManager.GetContentPromtDialog(); while (string.IsNullOrEmpty(comment) && !isCanceled) { } }); t.Wait(); isCanceled = RegistryManager.GetIsCanceledPromtDialog(); comment = RegistryManager.GetContentPromtDialog(); } if (!isCanceled || !shouldCommentWindowShow) { Task t1 = Task.Factory.StartNew(() => { this.TestCaseDetailedViewModel.TestCase.SetNewExecutionOutcome(ExecutionContext.Preferences.TestPlan, testCaseExecutionType, comment); this.TestCaseDetailedViewModel.TestCase.LastExecutionOutcome = testCaseExecutionType; }); t1.ContinueWith(antecedent => { this.NavigateToTestCasesInitialView(); }, TaskScheduler.FromCurrentSynchronizationContext()); } }
/// <summary> /// Sets the new execution outcome internal. /// </summary> private void SetNewExecutionOutcomeInternal(TestCaseExecutionType testCaseExecutionType) { bool shouldCommentWindowShow = RegistryManager.Instance.ReadShouldCommentWindowShow(); string comment = String.Empty; bool isCanceled = false; if (shouldCommentWindowShow && testCaseExecutionType != TestCaseExecutionType.Active) { UIRegistryManager.Instance.WriteTitleTitlePromtDialog(string.Empty); var dialog = new PrompDialogRichTextBoxWindow(); dialog.ShowDialog(); Task t = Task.Factory.StartNew(() => { isCanceled = UIRegistryManager.Instance.GetIsCanceledPromtDialog(); comment = UIRegistryManager.Instance.GetContentPromtDialog(); while (string.IsNullOrEmpty(comment) && !isCanceled) { } }); t.Wait(); isCanceled = UIRegistryManager.Instance.GetIsCanceledPromtDialog(); comment = UIRegistryManager.Instance.GetContentPromtDialog(); } if (!isCanceled || !shouldCommentWindowShow) { Task t1 = Task.Factory.StartNew(() => { this.TestCaseDetailedViewModel.TestCase.SetNewExecutionOutcome(ExecutionContext.Preferences.TestPlan, testCaseExecutionType, comment, ExecutionContext.TestCaseRuns); this.TestCaseDetailedViewModel.TestCase.LastExecutionOutcome = testCaseExecutionType; }); t1.ContinueWith(antecedent => { Navigator.Instance.NavigateToTestCasesInitialView(this); }, TaskScheduler.FromCurrentSynchronizationContext()); } }
/// <summary> /// Sets the new execution outcome internal. /// </summary> /// <param name="testCaseExecutionType">Type of the test case execution.</param> private void SetNewExecutionOutcomeInternal(TestCaseExecutionType testCaseExecutionType) { bool shouldCommentWindowShow = RegistryManager.ReadShouldCommentWindowShow(); string comment = string.Empty; bool isCanceled = false; if (shouldCommentWindowShow && testCaseExecutionType != TestCaseExecutionType.Active) { RegistryManager.WriteTitleTitlePromtDialog(string.Empty); var dialog = new PrompDialogRichTextBoxWindow(); dialog.ShowDialog(); Task t = Task.Factory.StartNew(() => { isCanceled = RegistryManager.GetIsCanceledPromtDialog(); comment = RegistryManager.GetContentPromtDialog(); while (string.IsNullOrEmpty(comment) && !isCanceled) { } }); t.Wait(); isCanceled = RegistryManager.GetIsCanceledPromtDialog(); comment = RegistryManager.GetContentPromtDialog(); } if (!isCanceled || !shouldCommentWindowShow) { this.ShowTestCasesProgressbar(); List<TestCase> selectedTestCases = this.GetSelectedTestCasesInternal(); Task t1 = Task.Factory.StartNew(() => { foreach (var currentTestCase in selectedTestCases) { currentTestCase.SetNewExecutionOutcome(ExecutionContext.Preferences.TestPlan, testCaseExecutionType, comment); currentTestCase.LastExecutionOutcome = testCaseExecutionType; } }); t1.ContinueWith(antecedent => { this.HideTestCasesProgressbar(); this.TestCasesInitialViewModel.FilterTestCases(); }, TaskScheduler.FromCurrentSynchronizationContext()); } }