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)
6
using System.CodeDom.Compiler;
7
using ICSharpCode.NRefactory;
8
using ICSharpCode.PythonBinding;
11
namespace PythonBinding.Tests.Converter
14
/// Tests the CSharpToPythonConverter correctly converts the class
15
/// constructor when a value is assigned to one of its fields.
18
public class IntegerClassFieldInitializedInConstructorTestFixture
20
string csharp = "class Foo\r\n" +
22
"\tprivate int i;\r\n" +
23
"\tpublic Foo()\r\n" +
30
public void ConvertedPythonCode()
32
NRefactoryToPythonConverter converter = new NRefactoryToPythonConverter(SupportedLanguage.CSharp);
33
string python = converter.Convert(csharp);
34
string expectedPython = "class Foo(object):\r\n" +
35
"\tdef __init__(self):\r\n" +
38
Assert.AreEqual(expectedPython, python);