diff --git a/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs index 9a7a87518b..4d11c525da 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs @@ -509,6 +509,44 @@ class TestClass int i; var f = NewMethod (i); } +}"); + } + + /// + /// Bug 10858 - Extract Method should use return, not out + /// + [Test] + [Ignore ("FIXME")] + public void TestBug10858 () + { + Test (@"class TestClass +{ + public static void TestMethod () + { + int i = 5, j, k = 7; + + <-j = i + k;-> + + System.Console.WriteLine (j); + + } +}", @"class TestClass +{ + static int NewMethod (int i, int k) + { + int j; + j = i + k; + return j + } + public static void TestMethod () + { + int i = 5, j, k = 7; + + j = NewMethod (i, k); + + System.Console.WriteLine (j); + + } }"); } }