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
/// Tests the CSharpToRubyConverter class can convert a C# property to
13
/// two get and set methods in Ruby.
16
public class PropertyConversionTestFixture
18
string csharp = "class Foo\r\n" +
20
" int count = 0;\r\n" +
21
" public int Count\r\n" +
23
" get { return count; }\r\n" +
24
" set { count = value; }\r\n" +
27
" public void Run()\r\n" +
33
public void ConvertedRubyCode()
35
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
36
converter.IndentString = " ";
37
string Ruby = converter.Convert(csharp);
40
" def initialize()\r\n" +
45
" return @count\r\n" +
48
" def Count=(value)\r\n" +
49
" @count = value\r\n" +
56
Assert.AreEqual(expectedRuby, Ruby);