Browse Source

Added extra unit tests.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5042 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
892c9f534e
  1. 10
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Console/PythonConsoleHomeKeyTestFixture.cs
  2. 17
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ConvertCSharpToPythonMenuCommandTestFixture.cs
  3. 16
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GeneratorMergeFindsInitializeComponentsTestFixture.cs

10
src/AddIns/BackendBindings/Python/PythonBinding/Test/Console/PythonConsoleHomeKeyTestFixture.cs

@ -41,5 +41,15 @@ namespace PythonBinding.Tests.Console @@ -41,5 +41,15 @@ namespace PythonBinding.Tests.Console
int expectedColumn = prompt.Length;
Assert.AreEqual(expectedColumn, textEditor.Column);
}
[Test]
public void HomeKeyPressedWhenTextInConsole()
{
textEditor.RaiseKeyPressEvent('a');
textEditor.RaiseDialogKeyPressEvent(Keys.Home);
int expectedColumn = prompt.Length;
Assert.AreEqual(expectedColumn, textEditor.Column);
}
}
}

17
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ConvertCSharpToPythonMenuCommandTestFixture.cs

@ -62,6 +62,23 @@ namespace PythonBinding.Tests.Converter @@ -62,6 +62,23 @@ namespace PythonBinding.Tests.Converter
Assert.AreEqual("Python", language);
}
[Test]
public void TabIndent()
{
MockTextEditorProperties properties = new MockTextEditorProperties();
properties.ConvertTabsToSpaces = false;
Assert.AreEqual("\t", NRefactoryToPythonConverter.GetIndentString(properties));
}
[Test]
public void TwoChaSpaceIndent()
{
MockTextEditorProperties properties = new MockTextEditorProperties();
properties.ConvertTabsToSpaces = true;
properties.IndentationSize = 2;
Assert.AreEqual(" ", NRefactoryToPythonConverter.GetIndentString(properties));
}
protected override void NewFile(string defaultName, string language, string content)
{
defaultFileName = defaultName;

16
src/AddIns/BackendBindings/Python/PythonBinding/Test/Designer/GeneratorMergeFindsInitializeComponentsTestFixture.cs

@ -124,21 +124,5 @@ namespace PythonBinding.Tests.Designer @@ -124,21 +124,5 @@ namespace PythonBinding.Tests.Designer
"\tdef InitializeComponents(self):\r\n" +
"\t\tpass\r\n";
}
string GetPythonCode()
{
return "from System.Windows.Forms import Form\r\n" +
"\r\n" +
"class MainForm(Form):\r\n" +
"\tdef __init__(self):\r\n" +
"\t\tself.InitializeComponent()\r\n" +
"\t\r\n" +
"\tdef InitializeComponent(self):\r\n" +
"\t\tself.SuspendLayout()\r\n" +
"\t\tself.ClientSize = System.Drawing.Size(499, 309)\r\n" +
"\t\tself.Name = 'MainForm'\r\n" +
"\t\tself.ResumeLayout(False)\r\n" +
"\t\tself.PerformLayout()\r\n";
}
}
}

Loading…
Cancel
Save