~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/VBExitConversionTests.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 ICSharpCode.NRefactory;
 
6
using ICSharpCode.RubyBinding;
 
7
using NUnit.Framework;
 
8
 
 
9
namespace RubyBinding.Tests.Converter
 
10
{
 
11
        [TestFixture]
 
12
        public class VBExitConversionTests
 
13
        {
 
14
                string vb =
 
15
                        "Public Class Class1\r\n" +
 
16
                        "    Public Sub Test\r\n" +
 
17
                        "        While True\r\n" +
 
18
                        "            Exit While\r\n" +
 
19
                        "        End While\r\n" +
 
20
                        "    End Sub\r\n" +
 
21
                        "End Class\r\n";
 
22
                
 
23
                [Test]
 
24
                public void ConvertedRubyCode()
 
25
                {
 
26
                        NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.VBNet);
 
27
                        converter.IndentString = "    ";
 
28
                        string ruby = converter.Convert(vb);
 
29
                        string expectedRuby =
 
30
                                "class Class1\r\n" +
 
31
                                "    def Test()\r\n" +
 
32
                                "        while true\r\n" +
 
33
                                "            break\r\n" +
 
34
                                "        end\r\n" +
 
35
                                "    end\r\n" +
 
36
                                "end";
 
37
                        
 
38
                        Assert.AreEqual(expectedRuby, ruby);
 
39
                }
 
40
        }
 
41
}