diff options
author | Keting Yang <ketyang@microsoft.com> | 2019-09-06 16:57:39 +0300 |
---|---|---|
committer | Keting Yang <ketyang@microsoft.com> | 2019-09-06 16:57:39 +0300 |
commit | 18751d54524db5f38ce7ddd79b20f6b464238f35 (patch) | |
tree | 15b1f1869c5d11ce75e5c98ffe0c483d30368d45 /main/src/addins/MonoDevelop.UnitTesting | |
parent | 7641d9e4e92fda18a399afc573ce3ff863f08c3c (diff) |
Disable "Show test source code" menu option when souceCodeLocation is null
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r-- | main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs index 7d5a90f862..3cd527da93 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs @@ -213,7 +213,14 @@ namespace MonoDevelop.UnitTesting if (loc != null) await IdeApp.Workbench.OpenDocument (loc.FileName, null, loc.Line, loc.Column); } - + + [CommandUpdateHandler (TestCommands.ShowTestCode)] + protected void OnUpdateShowTest (CommandInfo info) + { + UnitTest test = CurrentNode.DataItem as UnitTest; + info.Enabled = test.SourceCodeLocation != null; + } + [CommandHandler (TestCommands.GoToFailure)] protected async void OnShowFailure () { |