~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Designer/LoadTableLayoutPanelTestFixture.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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)
 
3
 
 
4
using System;
 
5
using System.Collections.Generic;
 
6
using System.Drawing;
 
7
using System.IO;
 
8
using System.Windows.Forms;
 
9
 
 
10
using ICSharpCode.RubyBinding;
 
11
using NUnit.Framework;
 
12
using RubyBinding.Tests.Utils;
 
13
 
 
14
namespace RubyBinding.Tests.Designer
 
15
{
 
16
        [TestFixture]
 
17
        public class LoadTableLayoutPanelTestFixture : LoadFormTestFixtureBase
 
18
        {               
 
19
                public override string RubyCode {
 
20
                        get {
 
21
                                return
 
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" +
 
29
                                        "        # \r\n" +
 
30
                                        "        # button1\r\n" +
 
31
                                        "        # \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" +
 
38
                                        "        # \r\n" +
 
39
                                        "        # checkBox1\r\n" +
 
40
                                        "        # \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" +
 
47
                                        "        # \r\n" +
 
48
                                        "        # tableLayoutPanel1\r\n" +
 
49
                                        "        # \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" +
 
58
                                        "        # \r\n" +
 
59
                                        "        # MainForm\r\n" +
 
60
                                        "        # \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" +
 
66
                                        "    end\r\n" +
 
67
                                        "end";
 
68
                        }
 
69
                }
 
70
                
 
71
                TableLayoutPanel TableLayoutPanel {
 
72
                        get { return Form.Controls[0] as TableLayoutPanel; }
 
73
                }
 
74
                
 
75
                [Test]
 
76
                public void ButtonAddedToTableLayout()
 
77
                {
 
78
                        Assert.IsInstanceOf(typeof(Button), TableLayoutPanel.Controls[0]);
 
79
                }
 
80
                
 
81
                [Test]
 
82
                public void CheckBoxAddedToTableLayout()
 
83
                {
 
84
                        Assert.IsInstanceOf(typeof(CheckBox), TableLayoutPanel.Controls[1]);
 
85
                }
 
86
        }
 
87
}