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)
5
using ICSharpCode.PythonBinding;
6
using ICSharpCode.SharpDevelop.Dom;
9
namespace PythonBinding.Tests.Parsing
12
public class ParseClassNestedInsideMethodTestFixture
14
ICompilationUnit compilationUnit;
18
public void SetUpFixture()
21
"class MyClass:\r\n" +
22
" def firstMethod(self):\r\n" +
23
" class NestedClass:\r\n" +
24
" def firstNestedClassMethod(self):\r\n" +
27
" def secondMethod(self):\r\n" +
31
DefaultProjectContent projectContent = new DefaultProjectContent();
32
PythonParser parser = new PythonParser();
33
compilationUnit = parser.Parse(projectContent, @"C:\test.py", python);
34
if (compilationUnit.Classes.Count > 0) {
35
c = compilationUnit.Classes[0];
40
public void CompilationUnitHasOneClass()
42
Assert.AreEqual(1, compilationUnit.Classes.Count);
46
public void MyClassHasTwoMethods()
48
Assert.AreEqual(2, c.Methods.Count);