@ -31,9 +31,11 @@ namespace PythonBinding.Tests.Designer
@@ -31,9 +31,11 @@ namespace PythonBinding.Tests.Designer
" # textBox1\r\n" +
" # \r\n" +
" self._textBox1.Name = \"textBoxName\"\r\n" +
" self._textBox1.Location = System.Drawing.Point(108, 120)\r\n" +
" # \r\n" +
" # form1\r\n" +
" # \r\n" +
" self.Location = System.Drawing.Point(10, 20)\r\n" +
" self.Name = \"form1\"\r\n" +
" self.Controls.Add(self._textBox1)\r\n" +
" self.ResumeLayout(False)\r\n" ;
@ -43,13 +45,6 @@ namespace PythonBinding.Tests.Designer
@@ -43,13 +45,6 @@ namespace PythonBinding.Tests.Designer
public TextBox TextBox {
get { return Form . Controls [ 0 ] as TextBox ; }
}
[Test]
public void TextBoxInstanceCreated ( )
{
CreatedInstance instance = new CreatedInstance ( typeof ( TextBox ) , new List < object > ( ) , "_textBox1" , false ) ;
Assert . Contains ( instance , CreatedInstances ) ;
}
[Test]
public void AddedComponentsContainsTextBox ( )
@ -59,7 +54,14 @@ namespace PythonBinding.Tests.Designer
@@ -59,7 +54,14 @@ namespace PythonBinding.Tests.Designer
AddedComponent component = new AddedComponent ( instance . Object as IComponent , "textBox1" ) ;
Assert . Contains ( component , AddedComponents ) ;
}
[Test]
public void TextBoxInstanceCreated ( )
{
CreatedInstance instance = new CreatedInstance ( typeof ( TextBox ) , new List < object > ( ) , null , false ) ;
Assert . Contains ( instance , CreatedInstances ) ;
}
[Test]
public void TextBoxAddedToForm ( )
{
@ -78,5 +80,23 @@ namespace PythonBinding.Tests.Designer
@@ -78,5 +80,23 @@ namespace PythonBinding.Tests.Designer
{
Assert . AreEqual ( "textBoxName" , TextBox . Name ) ;
}
[Test]
public void TextBoxLocation ( )
{
Assert . AreEqual ( new Point ( 1 0 8 , 1 2 0 ) , TextBox . Location ) ;
}
[Test]
public void CreatedInstancesDoesNotIncludeLocation ( )
{
Assert . IsNull ( GetCreatedInstance ( "Location" ) ) ;
}
[Test]
public void FormLocation ( )
{
Assert . AreEqual ( new Point ( 1 0 , 2 0 ) , Form . Location ) ;
}
}
}