Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4146 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
3 changed files with 46 additions and 1 deletions
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
// <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 System.CodeDom; |
||||
using System.CodeDom.Compiler; |
||||
using ICSharpCode.NRefactory; |
||||
using ICSharpCode.PythonBinding; |
||||
using NUnit.Framework; |
||||
|
||||
namespace PythonBinding.Tests.Converter |
||||
{ |
||||
[TestFixture] |
||||
public class BooleanVariableConversionTestFixture |
||||
{ |
||||
string csharp = "class Foo\r\n" + |
||||
"{\r\n" + |
||||
"\tbool a;\r\n" + |
||||
"\r\n" + |
||||
"\tpublic Foo()\r\n" + |
||||
"\t{\r\n" + |
||||
"\t\ta = true;\r\n" + |
||||
"\t}\r\n" + |
||||
"}"; |
||||
|
||||
[Test] |
||||
public void ConvertedPythonCode() |
||||
{ |
||||
NRefactoryToPythonConverter converter = new NRefactoryToPythonConverter(SupportedLanguage.CSharp); |
||||
string python = converter.Convert(csharp); |
||||
string expectedPython = "class Foo(object):\r\n" + |
||||
"\tdef __init__(self):\r\n" + |
||||
"\t\tself._a = True"; |
||||
|
||||
Assert.AreEqual(expectedPython, python); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue