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 System.Collections.Generic;
8
using System.Windows.Forms;
10
using ICSharpCode.RubyBinding;
11
using NUnit.Framework;
12
using RubyBinding.Tests.Utils;
14
namespace RubyBinding.Tests.Designer
17
public class LoadTableLayoutPanelTestFixture : LoadFormTestFixtureBase
19
public override string RubyCode {
22
"class MainForm < System::Windows::Forms::Form\r\n" +
23
" def InitializeComponent()\r\n" +
24
" @button1 = System::Windows::Forms::Button.new()\r\n" +
25
" @checkBox1 = System::Windows::Forms::CheckBox.new()\r\n" +
26
" @tableLayoutPanel1 = System::Windows::Forms::TableLayoutPanel.new()\r\n" +
27
" @tableLayoutPanel1.SuspendLayout()\r\n" +
28
" self.SuspendLayout()\r\n" +
32
" @button1.Location = System::Drawing::Point.new(3, 3)\r\n" +
33
" @button1.Name = \"button1\"\r\n" +
34
" @button1.Size = System::Drawing::Size.new(75, 23)\r\n" +
35
" @button1.TabIndex = 0\r\n" +
36
" @button1.Text = \"button1\"\r\n" +
37
" @button1.UseVisualStyleBackColor = true\r\n" +
41
" @checkBox1.Location = System::Drawing::Point.new(103, 3)\r\n" +
42
" @checkBox1.Name = \"checkBox1\"\r\n" +
43
" @checkBox1.Size = System::Drawing::Size.new(94, 24)\r\n" +
44
" @checkBox1.TabIndex = 1\r\n" +
45
" @checkBox1.Text = \"checkBox1\"\r\n" +
46
" @checkBox1.UseVisualStyleBackColor = true\r\n" +
48
" # tableLayoutPanel1\r\n" +
50
" @tableLayoutPanel1.ColumnCount = 2\r\n" +
51
" @tableLayoutPanel1.Controls.Add(@button1)\r\n" +
52
" @tableLayoutPanel1.Controls.Add(@checkBox1)\r\n" +
53
" @tableLayoutPanel1.Location = System::Drawing::Point.new(89, 36)\r\n" +
54
" @tableLayoutPanel1.Name = \"tableLayoutPanel1\"\r\n" +
55
" @tableLayoutPanel1.RowCount = 2\r\n" +
56
" @tableLayoutPanel1.Size = System::Drawing::Size.new(200, 100)\r\n" +
57
" @tableLayoutPanel1.TabIndex = 0\r\n" +
61
" self.ClientSize = System::Drawing::Size.new(284, 264)\r\n" +
62
" self.Controls.Add(@tableLayoutPanel1)\r\n" +
63
" self.Name = \"MainForm\"\r\n" +
64
" self.ResumeLayout(false)\r\n" +
65
" self.PerformLayout()\r\n" +
71
TableLayoutPanel TableLayoutPanel {
72
get { return Form.Controls[0] as TableLayoutPanel; }
76
public void ButtonAddedToTableLayout()
78
Assert.IsInstanceOf(typeof(Button), TableLayoutPanel.Controls[0]);
82
public void CheckBoxAddedToTableLayout()
84
Assert.IsInstanceOf(typeof(CheckBox), TableLayoutPanel.Controls[1]);