Browse Source

A form with a base class which is not System.Windows.Forms.Form can now be designed in the IronPython forms designer.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6401 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 15 years ago
parent
commit
bef6600d56
  1. 1
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonAstWalker.cs
  2. 11
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/ParseTestClassWithBaseClassTestFixture.cs

1
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonAstWalker.cs

@ -46,6 +46,7 @@ namespace ICSharpCode.PythonBinding
{ {
DefaultUsingScope usingScope = new DefaultUsingScope(); DefaultUsingScope usingScope = new DefaultUsingScope();
usingScope.NamespaceName = Path.GetFileNameWithoutExtension(fileName); usingScope.NamespaceName = Path.GetFileNameWithoutExtension(fileName);
usingScope.Parent = new DefaultUsingScope();
compilationUnit.UsingScope = usingScope; compilationUnit.UsingScope = usingScope;
} }

11
src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/ParseTestClassWithBaseClassTestFixture.cs

@ -71,8 +71,9 @@ namespace PythonBinding.Tests.Parsing
[Test] [Test]
public void CompilationUnitUsingScopeNamespaceNameIsNamespaceTakenFromFileName() public void CompilationUnitUsingScopeNamespaceNameIsNamespaceTakenFromFileName()
{ {
string namespaceName = compilationUnit.UsingScope.NamespaceName;
string expectedNamespace = "test"; string expectedNamespace = "test";
Assert.AreEqual(expectedNamespace, compilationUnit.UsingScope.NamespaceName); Assert.AreEqual(expectedNamespace, namespaceName);
} }
[Test] [Test]
@ -85,5 +86,13 @@ namespace PythonBinding.Tests.Parsing
string expectedBaseTypeName = "unittest.TestCase"; string expectedBaseTypeName = "unittest.TestCase";
Assert.AreEqual(expectedBaseTypeName, actualBaseTypeName); Assert.AreEqual(expectedBaseTypeName, actualBaseTypeName);
} }
[Test]
public void CompilationUnitUsingScopeHasParentUsingScopeWithNamespaceNameOfEmptyString()
{
IUsingScope parentUsingScope = compilationUnit.UsingScope.Parent;
string namespaceName = parentUsingScope.NamespaceName;
Assert.AreEqual(String.Empty, namespaceName);
}
} }
} }

Loading…
Cancel
Save