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)
5
using ICSharpCode.NRefactory;
6
using ICSharpCode.RubyBinding;
9
namespace RubyBinding.Tests.Converter
12
public class TernaryOperatorConversionTestFixture
14
string csharp = "class Foo\r\n" +
16
" public string TestMe(bool test)\r\n" +
18
" string a = test ? \"Ape\" : \"Monkey\";\r\n" +
24
public void ConvertedRubyCode()
26
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
27
converter.IndentString = " ";
28
string Ruby = converter.Convert(csharp);
29
string expectedRuby = "class Foo\r\n" +
30
" def TestMe(test)\r\n" +
31
" a = test ? \"Ape\" : \"Monkey\"\r\n" +
36
Assert.AreEqual(expectedRuby, Ruby);