From b63c53a4321099fb22b2bebf7cc7758447f02519 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Sat, 8 Oct 2005 14:06:15 +0000 Subject: [PATCH] Fixed SD2-476. Goto definition now works for unit tests in a test fixture containing a SetUp method. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@548 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Misc/MbUnitPad/Project/Src/TestTreeView.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/AddIns/Misc/MbUnitPad/Project/Src/TestTreeView.cs b/src/AddIns/Misc/MbUnitPad/Project/Src/TestTreeView.cs index c41105862b..f419712c0e 100644 --- a/src/AddIns/Misc/MbUnitPad/Project/Src/TestTreeView.cs +++ b/src/AddIns/Misc/MbUnitPad/Project/Src/TestTreeView.cs @@ -109,7 +109,7 @@ namespace ICSharpCode.MbUnitPad string fixtureName = null; switch (node.TestNodeType) { case TestNodeType.Test: - methodName = node.Text; + methodName = GetTestMethodName(node.Text); fixtureName = node.Parent.Text; break; @@ -142,6 +142,16 @@ namespace ICSharpCode.MbUnitPad } static MessageViewCategory testRunnerCategory; + + string GetTestMethodName(string methodName) + { + int index = methodName.IndexOf("."); + if (index >= 0) { + return methodName.Substring(index + 1); + } + + return methodName; + } void OnTestsStarted(object sender, EventArgs e) {