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.FormsDesigner;
6
using ICSharpCode.PythonBinding;
7
using ICSharpCode.Scripting.Tests.Utils;
8
using ICSharpCode.SharpDevelop.Dom;
10
using PythonBinding.Tests.Utils;
12
namespace PythonBinding.Tests.Designer
15
/// Base class that tests the PythonDesignerGenerator.InsertEventComponent method.
17
public class InsertEventHandlerTestFixtureBase
19
protected string file;
20
protected int position;
21
protected bool insertedEventHandler;
22
protected MockTextEditorViewContent mockViewContent;
23
protected DerivedFormDesignerViewContent viewContent;
24
protected string fileName = @"C:\Projects\Python\mainform.py";
25
protected DerivedPythonDesignerGenerator generator;
26
protected MockTextEditorOptions textEditorOptions;
29
public void SetUpFixture()
31
textEditorOptions = new MockTextEditorOptions();
32
generator = new DerivedPythonDesignerGenerator(textEditorOptions);
33
mockViewContent = new MockTextEditorViewContent();
34
viewContent = new DerivedFormDesignerViewContent(mockViewContent, new MockOpenedFile(fileName));
35
generator.Attach(viewContent);
36
viewContent.DesignerCodeFileContent = GetTextEditorCode();
38
PythonParser parser = new PythonParser();
39
ICompilationUnit parserCompilationUnit = parser.Parse(new DefaultProjectContent(), fileName, GetTextEditorCode());
40
ParseInformation parseInfo = new ParseInformation(parserCompilationUnit);
41
generator.ParseInfoToReturnFromParseFileMethod = parseInfo;
47
/// Called at the end of the SetUpFixture method.
49
public virtual void AfterSetUpFixture()
54
/// Gets the form's code.
56
protected virtual string GetTextEditorCode()