diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-01-20 19:32:53 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2014-10-21 18:39:14 +0400 |
commit | f73b2a9990495587d514aa1856919c21170a3940 (patch) | |
tree | 9842411ee8644ead5915a715ee7e53984a601df4 /main/src/addins/NUnit/Gui/TestPad.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
Diffstat (limited to 'main/src/addins/NUnit/Gui/TestPad.cs')
-rw-r--r-- | main/src/addins/NUnit/Gui/TestPad.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/main/src/addins/NUnit/Gui/TestPad.cs b/main/src/addins/NUnit/Gui/TestPad.cs index 9b2c1fc7c3..15ece94e07 100644 --- a/main/src/addins/NUnit/Gui/TestPad.cs +++ b/main/src/addins/NUnit/Gui/TestPad.cs @@ -44,6 +44,7 @@ using MonoDevelop.Projects; using Mono.TextEditor; using System.Linq; using MonoDevelop.Components; +using MonoDevelop.Ide.Commands; namespace MonoDevelop.NUnit { @@ -51,7 +52,7 @@ namespace MonoDevelop.NUnit { NUnitService testService = NUnitService.Instance; - IAsyncOperation runningTestOperation; + AsyncOperation runningTestOperation; VPaned paned; TreeView detailsTree; ListStore detailsStore; @@ -411,7 +412,7 @@ namespace MonoDevelop.NUnit { UnitTest test = GetSelectedTest (); if (test != null) { - SolutionEntityItem item = test.OwnerObject as SolutionEntityItem; + SolutionItem item = test.OwnerObject as SolutionItem; ExecutionModeCommandService.GenerateExecutionModeCommands ( item, test.CanRun, @@ -467,12 +468,12 @@ namespace MonoDevelop.NUnit return nav.DataItem as UnitTest; } - public IAsyncOperation RunTest (UnitTest test, IExecutionHandler mode) + public AsyncOperation RunTest (UnitTest test, IExecutionHandler mode) { return RunTest (FindTestNode (test), mode, false); } - IAsyncOperation RunTest (ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true) + AsyncOperation RunTest (ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true) { if (nav == null) return null; @@ -487,7 +488,7 @@ namespace MonoDevelop.NUnit if (bringToFront) IdeApp.Workbench.GetPad<TestPad> ().BringToFront (); runningTestOperation = testService.RunTest (test, mode); - runningTestOperation.Completed += (OperationHandler) DispatchService.GuiDispatch (new OperationHandler (OnTestSessionCompleted)); + runningTestOperation.Task.ContinueWith (t => OnTestSessionCompleted ()); return runningTestOperation; } @@ -501,10 +502,9 @@ namespace MonoDevelop.NUnit RunTest (TreeView.GetSelectedNode (), mode); } - void OnTestSessionCompleted (IAsyncOperation op) + void OnTestSessionCompleted () { - if (op.Success) - RefreshDetails (); + RefreshDetails (); runningTestOperation = null; this.buttonRunAll.Sensitive = true; this.buttonStop.Sensitive = false; |