diff options
author | Mike Krüger <mkrueger@novell.com> | 2011-05-17 08:25:42 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2011-05-17 08:25:42 +0400 |
commit | 058af3e1f49f0281e794d7e4459415b829888c2c (patch) | |
tree | 0574ebff73837d571e9e04fb8f489175e9359003 /main/tests/UnitTests/MonoDevelop.Refactoring | |
parent | 52a381a50b7b4a4d67c953898226b2eb1177633f (diff) |
Fixed 'Bug 693855 - Extracting variable from ELSE IF puts it in the
wrong place'.
Diffstat (limited to 'main/tests/UnitTests/MonoDevelop.Refactoring')
-rw-r--r-- | main/tests/UnitTests/MonoDevelop.Refactoring/DeclareLocalTests.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/main/tests/UnitTests/MonoDevelop.Refactoring/DeclareLocalTests.cs b/main/tests/UnitTests/MonoDevelop.Refactoring/DeclareLocalTests.cs index 90c57c83f2..4556d2d657 100644 --- a/main/tests/UnitTests/MonoDevelop.Refactoring/DeclareLocalTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Refactoring/DeclareLocalTests.cs @@ -65,6 +65,9 @@ namespace MonoDevelop.Refactoring.Tests "); } + /// <summary> + /// Bug 693855 - Extracting variable from ELSE IF puts it in the wrong place + /// </summary> [Test()] public void DeclareLocalexpressionTest () { @@ -85,5 +88,42 @@ namespace MonoDevelop.Refactoring.Tests } "); } + + /// <summary> + /// Bug 693855 - Extracting variable from ELSE IF puts it in the wrong place + /// </summary> + [Test()] + public void TestBug693855 () + { + TestDeclareLocal (@"class TestClass +{ + void Test () + { + string str = ""test""; + if (str == ""something"") { + //do A + } else if (<-str == ""other""->) { + //do B + } else { + //do C + } + } +}", +@"class TestClass +{ + void Test () + { + string str = ""test""; + bool b = str == ""other""; + if (str == ""something"") { + //do A + } else if (b) { + //do B + } else { + //do C + } + } +}"); + } } } |