~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Test/ComplexTests.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using NUnit.Framework;
 
6
 
 
7
namespace NRefactoryToBooConverter.Tests
 
8
{
 
9
        [TestFixture]
 
10
        public class ComplexTests : TestHelper
 
11
        {
 
12
                [Test]
 
13
                public void MovingLocals()
 
14
                {
 
15
                        TestInClass("public void Run() { if (a) { int b = 1; } else { int b = 2; } }",
 
16
                                    "public def Run() as System.Void:\n" +
 
17
                                    "\tb as System.Int32\n" +
 
18
                                    "\tif a:\n" +
 
19
                                    "\t\tb = 1\n" +
 
20
                                    "\telse:\n" +
 
21
                                    "\t\tb = 2");
 
22
                }
 
23
                
 
24
                [Test]
 
25
                public void RenamingLocals()
 
26
                {
 
27
                        TestInClass("public void Run() { if (a) { int b = 1; } else { double b = 2; } }",
 
28
                                    "public def Run() as System.Void:\n" +
 
29
                                    "\tif a:\n" +
 
30
                                    "\t\tb as System.Int32 = 1\n" +
 
31
                                    "\telse:\n" +
 
32
                                    "\t\tb__2 as System.Double = 2");
 
33
                }
 
34
        }
 
35
}