Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[CodeIssues] Added failing test case for variable declared in wide

scope issue.
  • Loading branch information...
commit 2f91ba1df85d41ad7ef1bc6a7348c7fee26b2ef5 1 parent ae24ec4
@mkrueger mkrueger authored
View
39 ICSharpCode.NRefactory.Tests/CSharp/CodeIssues/VariableDeclaredInWideScopeTests.cs
@@ -236,7 +236,7 @@ void F()
var issues = GetIssues(new VariableDeclaredInWideScopeIssue(), input, out context);
Assert.AreEqual(0, issues.Count);
}
-
+
[Test]
public void DoesNotSuggestMovingIntoClosure ()
{
@@ -418,6 +418,43 @@ public void DoesNotInsertBlockStatementInResourceAquisition ()
return;
", 0);
}
+
+ [Ignore("FIXME")]
+ [Test]
+ public void DoesNotSuggestMovingIntoBodyAfterMethodCall()
+ {
+ var input = @"
+using System.IO;
+
+class FooBar
+{
+ public int foo = 5;
+ public void ChangeFoo ()
+ {
+ foo = 10;
+ }
+}
+
+class A
+{
+ FooBar foo = new FooBar();
+
+ public void F()
+ {
+ int length = foo.foo;
+ foo.ChangeFoo ();
+ if (true) {
+ System.Console.WriteLine (length);
+ }
+ }
+}";
+ TestRefactoringContext context;
+ var issues = GetIssues(new VariableDeclaredInWideScopeIssue(), input, out context);
+ Assert.AreEqual(0, issues.Count);
+ }
+
+
+
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.