diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs index 3831b3a54d..66834ca7f3 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/NRefactoryToPythonConverter.cs @@ -1170,7 +1170,7 @@ namespace ICSharpCode.PythonBinding public override object TrackedVisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) { - Console.WriteLine("VisitTypeReferenceExpression"); + Append(GetTypeName(typeReferenceExpression.TypeReference)); return null; } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ObjectReferenceEqualsConversionTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ObjectReferenceEqualsConversionTestFixture.cs new file mode 100644 index 0000000000..c6bc0a02d0 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ObjectReferenceEqualsConversionTestFixture.cs @@ -0,0 +1,40 @@ +// +// +// +// +// $Revision$ +// + +using System; +using ICSharpCode.NRefactory; +using ICSharpCode.PythonBinding; +using NUnit.Framework; + +namespace PythonBinding.Tests.Converter +{ + [TestFixture] + public class ObjectReferenceEqualsConversionTestFixture + { + string csharp = "class Foo\r\n" + + "{\r\n" + + " public bool IsEqual(object o)\r\n" + + " {\r\n" + + " return object.ReferenceEquals(o, null);\r\n" + + " }\r\n" + + "}"; + + [Test] + public void ConvertedPythonCode() + { + NRefactoryToPythonConverter converter = new NRefactoryToPythonConverter(SupportedLanguage.CSharp); + converter.IndentString = " "; + string python = converter.Convert(csharp); + string expectedPython = "class Foo(object):\r\n" + + " def IsEqual(self, o):\r\n" + + " return Object.ReferenceEquals(o, None)"; + + Assert.AreEqual(expectedPython, python, python); + } + } +} + diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj index 9f19d62b91..ea8ad5737d 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj @@ -138,6 +138,7 @@ +