Browse Source

Added extract method unit test.

pull/32/merge
Mike Krüger 13 years ago
parent
commit
f0c43cdb56
  1. 38
      ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs

38
ICSharpCode.NRefactory.Tests/CSharp/CodeActions/ExtractMethodTests.cs

@ -509,6 +509,44 @@ class TestClass @@ -509,6 +509,44 @@ class TestClass
int i;
var f = NewMethod (i);
}
}");
}
/// <summary>
/// Bug 10858 - Extract Method should use return, not out
/// </summary>
[Test]
[Ignore ("FIXME")]
public void TestBug10858 ()
{
Test<ExtractMethodAction> (@"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);
}
}");
}
}

Loading…
Cancel
Save