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.
39 lines
990 B
39 lines
990 B
// <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.PythonBinding; |
|
using NUnit.Framework; |
|
|
|
namespace PythonBinding.Tests.Converter |
|
{ |
|
[TestFixture] |
|
public class ModulusOperatorConversionTestFixture |
|
{ |
|
string csharp = "class Foo\r\n" + |
|
"{\r\n" + |
|
"\tpublic void Convert(int a)\r\n" + |
|
"\t{\r\n" + |
|
"\t\ta %= 5;\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 Convert(self, a):\r\n" + |
|
"\t\ta %= 5"; |
|
|
|
Assert.AreEqual(expectedPython, python); |
|
} |
|
} |
|
} |
|
|
|
|