You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
58 lines
1.7 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using System; |
|
using ICSharpCode.NRefactory; |
|
using ICSharpCode.RubyBinding; |
|
using NUnit.Framework; |
|
|
|
namespace RubyBinding.Tests.Converter |
|
{ |
|
[TestFixture] |
|
public class UsingStatementConversionTestFixture |
|
{ |
|
string csharp = "using System\r\n" + |
|
"class Foo\r\n" + |
|
"{\r\n" + |
|
"}"; |
|
|
|
[Test] |
|
public void GeneratedRubyCode() |
|
{ |
|
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp); |
|
string Ruby = converter.Convert(csharp); |
|
string expectedRuby = "require \"mscorlib\"\r\n" + |
|
"require \"System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\r\n" + |
|
"\r\n" + |
|
"class Foo\r\n" + |
|
"end"; |
|
|
|
Assert.AreEqual(expectedRuby, Ruby); |
|
} |
|
|
|
[Test] |
|
public void MultipleUsingStatements() |
|
{ |
|
string csharp = "using System\r\n" + |
|
"using System.Drawing\r\n" + |
|
"class Foo\r\n" + |
|
"{\r\n" + |
|
"}"; |
|
|
|
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp); |
|
string Ruby = converter.Convert(csharp); |
|
string expectedRuby = "require \"mscorlib\"\r\n" + |
|
"require \"System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\r\n" + |
|
"require \"System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\r\n" + |
|
"\r\n" + |
|
"class Foo\r\n" + |
|
"end"; |
|
|
|
Assert.AreEqual(expectedRuby, Ruby); |
|
} |
|
} |
|
}
|
|
|