~ubuntu-branches/ubuntu/utopic/monodevelop/utopic

« back to all changes in this revision

Viewing changes to src/addins/NUnit/Gui/TestPad.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-10-10 14:50:04 UTC
  • mfrom: (10.3.4)
  • Revision ID: package-import@ubuntu.com-20131010145004-80l130sny21b17sb
Tags: 4.0.12+dfsg-1
* [5dcb6e1] Fix debian/watch for new source tarball name format
* [5c68cb5] Refresh list of files removed by get-orig-source to 
  reflect 4.0.12
* [96d60a0] Imported Upstream version 4.0.12+dfsg
* [b989752] Refresh debian/patches/no_appmenu to ensure it applies
* [2a4c351] Ensure every assembly in external/ is cleaned properly
* [92762f7] Add more excluded Mac-specific modulerefs
* [bc698ba] Add symlinks to NUnit assemblies (Closes: #714246)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
using MonoDevelop.Ide;
43
43
using MonoDevelop.Projects;
44
44
using Mono.TextEditor;
 
45
using System.Linq;
45
46
 
46
47
namespace MonoDevelop.NUnit
47
48
{
420
421
                        }
421
422
                }
422
423
                
 
424
                [CommandHandler (TestCommands.DebugTest)]
 
425
                protected void OnDebugTest (object data)
 
426
                {
 
427
                        var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
 
428
                        var mode = debugModeSet.ExecutionModes.First (m => m.Id == (string)data);
 
429
                        RunSelectedTest (mode.ExecutionHandler);
 
430
                }
 
431
 
 
432
                [CommandUpdateHandler (TestCommands.DebugTest)]
 
433
                protected void OnUpdateDebugTest (CommandArrayInfo info)
 
434
                {
 
435
                        var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
 
436
                        if (debugModeSet == null)
 
437
                                return;
 
438
 
 
439
                        UnitTest test = GetSelectedTest ();
 
440
                        if (test == null)
 
441
                                return;
 
442
 
 
443
                        foreach (var mode in debugModeSet.ExecutionModes) {
 
444
                                if (test.CanRun (mode.ExecutionHandler))
 
445
                                        info.Add (GettextCatalog.GetString ("Debug Test ({0})", mode.Name), mode.Id);
 
446
                        }
 
447
                        if (info.Count == 1)
 
448
                                info [0].Text = GettextCatalog.GetString ("Debug Test");
 
449
                }
 
450
 
423
451
                public TestPad ()
424
452
                {
425
453
                        base.TreeView.CurrentItemActivated += delegate {
453
481
                        UnitTest test = nav.DataItem as UnitTest;
454
482
                        if (test == null)
455
483
                                return;
456
 
                        TestSession.ResetResult (test.RootTest);
 
484
                        NUnitService.ResetResult (test.RootTest);
457
485
                        
458
486
                        this.buttonRun.Sensitive = false;
459
487
                        this.buttonRunAll.Sensitive = false;