\r
using NUnit.Framework;\r
\r
-[TestFixture]\r
-public class ControlTest\r
+namespace MWF.Test\r
{\r
- [Test]\r
- public void PubPropTest()\r
- {\r
- Control c = new Control();\r
- Assert.AreEqual(false, c.AccessibilityObject == null, "#1");\r
- Assert.AreEqual(false, c.AllowDrop , "#2");\r
- Assert.AreEqual(AnchorStyles.Top | AnchorStyles.Left, c.Anchor, "#4");\r
- Assert.AreEqual("Control", c.BackColor.Name , "#6");\r
- Assert.AreEqual(null, c.BindingContext, "#7");\r
- Assert.AreEqual(null, c.BackgroundImage, "#8");\r
- Assert.AreEqual(0, c.Bottom, "#10");\r
- //Assert.AreEqual (Rectangle (0,0, 100, 23) , c.Bounds , "#11");\r
- //Assert.AreEqual ( BoundsSpecified.X , c.Bounds , "#11");\r
- Assert.AreEqual(false, c.CanFocus, "#12");\r
- Assert.AreEqual(true, c.CanSelect, "#13");\r
- Assert.AreEqual(false, c.Capture, "#14");\r
- Assert.AreEqual(true, c.CausesValidation, "#15");\r
- //Assert.AreEqual (false , c.ClientRectangle , "#16");\r
- //Assert.AreEqual (false , c.ClientSize , "#17");\r
- // Assert.AreEqual("Mono Project, Novell, Inc.", c.CompanyName, "#18");\r
- Assert.AreEqual(null, c.Container, "#19");\r
- Assert.AreEqual(false, c.ContainsFocus, "#20");\r
- Assert.AreEqual(null, c.ContextMenu, "#21");\r
- //Assert.AreEqual (Control+ControlCollection , c.Controls, "#22");\r
- Assert.AreEqual(true, c.Created, "#23");\r
- Assert.AreEqual(Cursors.Default, c.Cursor, "#24");\r
- Assert.AreEqual(false, c.DataBindings == null, "#25");\r
- //Assert.AreEqual(false, c.DefaultBackColor, "#25a");\r
- //Assert.AreEqual(false, c.DefaultForeColor == null, "#25b");\r
- //Assert.AreEqual(false, c.DefaultFont == null, "#25c");\r
- //Assert.AreEqual (false , c.DisplayRectangle , "#26");\r
- //<{X=0,Y=0,Width=100,Height=23}>\r
- Assert.AreEqual(false, c.Disposing, "#27");\r
- Assert.AreEqual(DockStyle.None, c.Dock, "#28");\r
- Assert.AreEqual(true, c.Enabled, "#29");\r
- Assert.AreEqual(false, c.Focused, "#31");\r
- //Assert.AreEqual(FontFamily.GenericSansSerif, c.Font, "#32");\r
- Assert.AreEqual(SystemColors.ControlText, c.ForeColor, "#33");\r
- //Assert.AreEqual (IWin32Window.Handle , c.Handle, "#34");\r
- Assert.AreEqual(false, c.HasChildren, "#35");\r
- Assert.AreEqual(0, c.Height, "#36");\r
- //Assert.AreEqual (false , c.ImeMode, "#41");\r
- Assert.AreEqual(false, c.InvokeRequired, "#42");\r
- Assert.AreEqual(false, c.IsAccessible, "#43");\r
- Assert.AreEqual(false, c.IsDisposed, "#44");\r
- Assert.AreEqual(true, c.IsHandleCreated, "#45");\r
- Assert.AreEqual(0, c.Left, "#46");\r
- Assert.AreEqual(Point.Empty, c.Location, "#47");\r
- //Assert.AreEqual(Point.Empty, c.ModifierKeys, "#47a");\r
- //Assert.AreEqual(Point.Empty, c.MousePosition, "#47b");\r
- //Assert.AreEqual(Point.Empty, c.MouseButtons, "#47c");\r
- Assert.AreEqual("", c.Name, "#48");\r
- Assert.AreEqual(null, c.Parent, "#49");\r
- //Assert.AreEqual("Novell Mono MWF", c.ProductName, "#52");\r
- Assert.AreEqual("1.1.4322.573", c.ProductVersion, "#53");\r
- Assert.AreEqual(false, c.RecreatingHandle, "#54");\r
- Assert.AreEqual(null, c.Region, "#55");\r
- Assert.AreEqual(0, c.Right, "#56");\r
- Assert.AreEqual(RightToLeft.No, c.RightToLeft, "#57");\r
- Assert.AreEqual(null, c.Site, "#58");\r
- //Assert.AreEqual (false , c.Size, "#59");\r
- //Assert.AreEqual(true , c.TabIndex , "#60");\r
- //true , 0\r
- Assert.AreEqual(true, c.TabStop, "#60a");\r
- Assert.AreEqual(null, c.Tag, "#61");\r
- Assert.AreEqual("", c.Text, "#62");\r
- Assert.AreEqual(0, c.Top, "#64");\r
- Assert.AreEqual(null, c.TopLevelControl, "#65");\r
- Assert.AreEqual(true, c.Visible, "#67");\r
- Assert.AreEqual(0, c.Width, "#68");\r
- \r
- }\r
- \r
- [Test]\r
- public void PubMethodTest2()\r
- {\r
- Control C1 = new Control();\r
- Control ctl = new Control();\r
- C1.Show() ;\r
- Assert.AreEqual(true , C1.Visible , "#69");\r
- Assert.AreEqual(false, C1.Contains(ctl) , "#70");\r
- Assert.AreEqual("System.Windows.Forms.Control", C1.ToString() , "#71");\r
- \r
- //C1.Update ();\r
- //Assert.AreEqual(false, C1 , "#70");\r
- //Causes the control to redraw the invalidated regions within its client area.\r
- \r
- C1.Anchor = AnchorStyles.Top;\r
- C1.SuspendLayout ();\r
- C1.Anchor = AnchorStyles.Left ;\r
- C1.ResumeLayout ();\r
- Assert.AreEqual(AnchorStyles.Left , C1.Anchor, "#73");\r
- \r
- C1.SetBounds(10, 20, 30, 40) ;\r
- Assert.AreEqual( 20 ,C1.Bounds.Top , "#74a");\r
- Assert.AreEqual( 10 ,C1.Bounds.Left , "#74b");\r
- Assert.AreEqual( 30 ,C1.Bounds.Width , "#74c");\r
- Assert.AreEqual( 40 ,C1.Bounds.Height , "#74d");\r
- \r
- //C1.SendToBack() ;\r
- //Assert.AreEqual( false , C1.Bounds , "#75");\r
- \r
- }\r
-\r
- [Test]\r
- public void PubMethodTest3()\r
- {\r
- Control B = new Control();\r
- //Form frm = new Form.ControlNativeWindow() ;\r
- //B.SelectNextControl(frm) ;\r
- //Assert.AreEqual(true, B.TabStop , "#75");\r
- //LayoutEventArgs l = LayoutEventArgs ();\r
- //Layout L1 = B.PerformLayout(l) ;\r
- //Anchor = AnchorStyles.Bottom\r
- B.SuspendLayout() ;\r
- B.Size = Size.Empty ;\r
- B.Location = Point.Empty;\r
- B.Anchor = AnchorStyles.Bottom;\r
- B.Dock = DockStyle.Left;\r
- B.ResumeLayout() ;\r
- //Assert.AreEqual(false, B.Size , "#75a");\r
- //Assert.AreEqual(false, B.Location , "#75b");\r
- Assert.AreEqual(AnchorStyles.Top | AnchorStyles.Left , B.Anchor , "#75c");\r
- Assert.AreEqual(DockStyle.None , B.Dock , "#75d");\r
- \r
- }\r
- \r
- [Test]\r
- public void PubMethodTest4()\r
+ [TestFixture]\r
+ public class ControlTest\r
{\r
- Control s1 = new Control();\r
- Control s2 = new Control();\r
- s1.Text = "abc";\r
- s2.Text = "abc";\r
- Assert.AreEqual(false, s1.Equals(s2), "#76");\r
- Assert.AreEqual(true, s1.Equals(s1), "#77");\r
+ internal static void TestAccessibility(Control c, string Default, string Description, string Name, AccessibleRole Role) {\r
+ Assert.AreEqual(false, c.AccessibilityObject == null, "Acc1");\r
+ Assert.AreEqual(Default, c.AccessibleDefaultActionDescription, "Acc2");\r
+ Assert.AreEqual(Description, c.AccessibleDescription, "Acc3");\r
+ Assert.AreEqual(Name, c.AccessibleName, "Acc4");\r
+ Assert.AreEqual(Role, c.AccessibleRole, "Acc5");\r
+ }\r
+\r
+ [Test]\r
+ public void PubPropTest()\r
+ {\r
+ Control c = new Control();\r
+\r
+ TestAccessibility(c, null, null, null, AccessibleRole.Default);\r
+\r
+ // A\r
+ Assert.AreEqual(false, c.AllowDrop , "A1");\r
+ Assert.AreEqual(AnchorStyles.Top | AnchorStyles.Left, c.Anchor, "A2");\r
+\r
+ // B\r
+ Assert.AreEqual("Control", c.BackColor.Name , "B1");\r
+ Assert.AreEqual(null, c.BackgroundImage, "B2");\r
+ Assert.AreEqual(null, c.BindingContext, "B3");\r
+ Assert.AreEqual(0, c.Bottom, "B4");\r
+ Assert.AreEqual (new Rectangle (0,0, 0, 0) , c.Bounds , "B5");\r
+\r
+ // C\r
+ Assert.AreEqual(false, c.CanFocus, "C1");\r
+ Assert.AreEqual(true, c.CanSelect, "C2");\r
+ Assert.AreEqual(false, c.Capture, "C3");\r
+ Assert.AreEqual(true, c.CausesValidation, "C4");\r
+ Assert.AreEqual (new Rectangle(0, 0, 0, 0) , c.ClientRectangle , "C5");\r
+ Assert.AreEqual (new Size(0, 0), c.ClientSize , "C6");\r
+\r
+ string name = c.CompanyName;\r
+ if (!name.Equals("Mono Project, Novell, Inc.") && !name.Equals("Microsoft Corporation")) {\r
+ Assert.Fail("CompanyName property does not match any accepted value - C7");\r
+ }\r
+ Assert.AreEqual(null, c.Container, "C8");\r
+ Assert.AreEqual(false, c.ContainsFocus, "C9");\r
+ Assert.AreEqual(null, c.ContextMenu, "C10");\r
+ Assert.AreEqual(0, c.Controls.Count, "C11");\r
+ Assert.AreEqual(true, c.Created, "C12");\r
+ Assert.AreEqual(Cursors.Default, c.Cursor, "C13");\r
+\r
+ // D\r
+ Assert.AreEqual(false, c.DataBindings == null, "D1");\r
+ Assert.AreEqual("Control", Control.DefaultBackColor.Name, "D2");\r
+ Assert.AreEqual("ControlText", Control.DefaultForeColor.Name, "D3");\r
+ Assert.AreEqual(FontStyle.Regular, Control.DefaultFont.Style, "D4");\r
+ Assert.AreEqual (new Rectangle(0, 0, 0, 0), c.DisplayRectangle , "D5");\r
+ Assert.AreEqual(false, c.Disposing, "D6");\r
+ Assert.AreEqual(DockStyle.None, c.Dock, "D7");\r
+\r
+ // E\r
+ Assert.AreEqual(true, c.Enabled, "E1");\r
+\r
+ // F\r
+ Assert.AreEqual(false, c.Focused, "F1");\r
+ Assert.AreEqual(FontStyle.Regular, c.Font.Style, "F2");\r
+ Assert.AreEqual(SystemColors.ControlText, c.ForeColor, "F3");\r
+\r
+ // G\r
+\r
+ // H\r
+ Assert.AreEqual (((IWin32Window)c).Handle, c.Handle, "H1");\r
+ Assert.AreEqual(false, c.HasChildren, "H2");\r
+ Assert.AreEqual(0, c.Height, "H3");\r
+\r
+ // I\r
+ Assert.AreEqual (ImeMode.NoControl, c.ImeMode, "I1");\r
+ Assert.AreEqual(false, c.InvokeRequired, "I2");\r
+ Assert.AreEqual(false, c.IsAccessible, "I3");\r
+ Assert.AreEqual(false, c.IsDisposed, "I4");\r
+ Assert.AreEqual(true, c.IsHandleCreated, "I5");\r
+\r
+ // J\r
+\r
+ // K\r
+\r
+ // L\r
+ Assert.AreEqual(0, c.Left, "L1");\r
+ Assert.AreEqual(Point.Empty, c.Location, "L2");\r
+\r
+ // M\r
+ Assert.AreEqual(Keys.None, Control.ModifierKeys, "M1");\r
+ Assert.AreEqual(false, Control.MousePosition.IsEmpty, "M2");\r
+ Assert.AreEqual(MouseButtons.None, Control.MouseButtons, "M3");\r
+\r
+ // N\r
+ Assert.AreEqual("", c.Name, "N1");\r
+\r
+ // O\r
+\r
+ // P\r
+ Assert.AreEqual(null, c.Parent, "P1");\r
+ name = c.ProductName;\r
+ if (!name.Equals("Novell Mono MWF") && !name.Equals("Microsoft (R) .NET Framework"))\r
+ Assert.Fail("ProductName property does not match any accepted value - P2");\r
+\r
+ name = c.ProductVersion;\r
+ if (!name.Equals("1.1.4322.2032")) {\r
+ Assert.Fail("This test is being run against the wrong framework version.\nExpected is Net 1.1sp1. - P3");\r
+ }\r
+\r
+ // R\r
+ Assert.AreEqual(false, c.RecreatingHandle, "R1");\r
+ Assert.AreEqual(null, c.Region, "R2");\r
+ Assert.AreEqual(0, c.Right, "R3");\r
+ Assert.AreEqual(RightToLeft.No, c.RightToLeft, "R4");\r
+\r
+ // S\r
+ Assert.AreEqual(null, c.Site, "S1");\r
+ Assert.AreEqual (new Size(0, 0), c.Size, "S2");\r
+\r
+ // T\r
+ Assert.AreEqual(0, c.TabIndex , "T1");\r
+ Assert.AreEqual(true, c.TabStop, "T2");\r
+ Assert.AreEqual(null, c.Tag, "T3");\r
+ Assert.AreEqual("", c.Text, "T4");\r
+ Assert.AreEqual(0, c.Top, "T5");\r
+ Assert.AreEqual(null, c.TopLevelControl, "T6");\r
+\r
+ // U\r
+\r
+ // V\r
+ Assert.AreEqual(true, c.Visible, "V1");\r
+\r
+ // W\r
+ Assert.AreEqual(0, c.Width, "W1");\r
+\r
+ // XYZ\r
+ }\r
+\r
+ [Test]\r
+ public void RelationTest() {\r
+ Control c1;\r
+ Control c2;\r
+\r
+ c1 = new Control();\r
+ c2 = new Control();\r
+\r
+ Assert.AreEqual(true , c1.Visible , "Rel1");\r
+ Assert.AreEqual(false, c1.Contains(c2) , "Rel2");\r
+ Assert.AreEqual("System.Windows.Forms.Control", c1.ToString() , "Rel3");\r
+\r
+ c1.Controls.Add(c2);\r
+ Assert.AreEqual(true , c2.Visible , "Rel4");\r
+ Assert.AreEqual(true, c1.Contains(c2) , "Rel5");\r
+\r
+ c1.Anchor = AnchorStyles.Top;\r
+ c1.SuspendLayout ();\r
+ c1.Anchor = AnchorStyles.Left ;\r
+ c1.ResumeLayout ();\r
+ Assert.AreEqual(AnchorStyles.Left , c1.Anchor, "Rel6");\r
+\r
+ c1.SetBounds(10, 20, 30, 40) ;\r
+ Assert.AreEqual(new Rectangle(10, 20, 30, 40), c1.Bounds, "Rel7");\r
+\r
+ Assert.AreEqual(c1, c2.Parent, "Rel8");\r
+ }\r
+\r
+ private string TestControl(Control container, Control start, bool forward) {\r
+ Control ctl;\r
+\r
+ ctl = container.GetNextControl(start, forward);\r
+\r
+ if (ctl == null) {\r
+ return null;\r
+ }\r
+\r
+ return ctl.Text;\r
+ }\r
+\r
+ [Test]\r
+ public void TabOrder() {\r
+ Form form;\r
+ Control active;\r
+
+ Label label1 = new Label(); // To test non-tabstop items as well
+ Label label2 = new Label();
+
+ GroupBox group1 = new GroupBox();
+ GroupBox group2 = new GroupBox();
+ GroupBox group3 = new GroupBox();
+
+ TextBox text1 = new TextBox();
+
+ RadioButton radio11 = new RadioButton();
+ RadioButton radio12 = new RadioButton();
+ RadioButton radio13 = new RadioButton();
+ RadioButton radio14 = new RadioButton();
+ RadioButton radio21 = new RadioButton();
+ RadioButton radio22 = new RadioButton();
+ RadioButton radio23 = new RadioButton();
+ RadioButton radio24 = new RadioButton();
+ RadioButton radio31 = new RadioButton();
+ RadioButton radio32 = new RadioButton();
+ RadioButton radio33 = new RadioButton();
+ RadioButton radio34 = new RadioButton();
+
+ form = new Form();
+
+ form.ClientSize = new System.Drawing.Size (520, 520);\r
+ Assert.AreEqual(new Size(520, 520), form.ClientSize, "Tab1");\r
+\r
+ form.Text = "SWF Taborder Test App Form";\r
+ Assert.AreEqual("SWF Taborder Test App Form", form.Text, "Tab2");\r
+\r
+ label1.Location = new Point(10, 10);\r
+ Assert.AreEqual(new Point(10, 10), label1.Location, "Tab3");\r
+ label1.Text = "Label1";\r
+ form.Controls.Add(label1);\r
+\r
+ label2.Location = new Point(200, 10);\r
+ label2.Text = "Label2";\r
+ form.Controls.Add(label2);\r
+\r
+ group1.Text = "Group1";\r
+ group2.Text = "Group2";\r
+ group3.Text = "Group3";\r
+\r
+ group1.Size = new Size(200, 400);\r
+ group2.Size = new Size(200, 400);\r
+ group3.Size = new Size(180, 180);\r
+ Assert.AreEqual(new Size(180, 180), group3.Size, "Tab4");\r
+\r
+ group1.Location = new Point(10, 40);\r
+ group2.Location = new Point(220, 40);\r
+ group3.Location = new Point(10, 210);\r
+\r
+ group1.TabIndex = 30;\r
+ Assert.AreEqual(30, group1.TabIndex, "Tab5");\r
+ group1.TabStop = true;\r
+\r
+ // Don't assign, test automatic assignment\r
+ //group2.TabIndex = 0;\r
+ group2.TabStop = true;\r
+ Assert.AreEqual(0, group2.TabIndex, "Tab6");\r
+\r
+ group3.TabIndex = 35;\r
+ group3.TabStop = true;\r
+\r
+ // Test default tab index\r
+ Assert.AreEqual(0, radio11.TabIndex, "Tab7");\r
+\r
+ text1.Text = "Edit Control";\r
+\r
+ radio11.Text = "Radio 1-1 [Tab1]";\r
+ radio12.Text = "Radio 1-2 [Tab2]";\r
+ radio13.Text = "Radio 1-3 [Tab3]";\r
+ radio14.Text = "Radio 1-4 [Tab4]";\r
+\r
+ radio21.Text = "Radio 2-1 [Tab4]";\r
+ radio22.Text = "Radio 2-2 [Tab3]";\r
+ radio23.Text = "Radio 2-3 [Tab2]";\r
+ radio24.Text = "Radio 2-4 [Tab1]";\r
+\r
+ radio31.Text = "Radio 3-1 [Tab1]";\r
+ radio32.Text = "Radio 3-2 [Tab3]";\r
+ radio33.Text = "Radio 3-3 [Tab2]";\r
+ radio34.Text = "Radio 3-4 [Tab4]";\r
+\r
+ // We don't assign TabIndex for radio1X; test automatic assignment\r
+ text1.TabStop = true;\r
+ radio11.TabStop = true;\r
+\r
+ radio21.TabIndex = 4;\r
+ radio22.TabIndex = 3;\r
+ radio23.TabIndex = 2;\r
+ radio24.TabIndex = 1;\r
+ radio24.TabStop = true;\r
+\r
+ radio31.TabIndex = 11;\r
+ radio31.TabStop = true;\r
+ radio32.TabIndex = 13;\r
+ radio33.TabIndex = 12;\r
+ radio34.TabIndex = 14;\r
+\r
+ text1.Location = new Point(10, 100);\r
+\r
+ radio11.Location = new Point(10, 20);\r
+ radio12.Location = new Point(10, 40);\r
+ radio13.Location = new Point(10, 60);\r
+ radio14.Location = new Point(10, 80);\r
+\r
+ radio21.Location = new Point(10, 20);\r
+ radio22.Location = new Point(10, 40);\r
+ radio23.Location = new Point(10, 60);\r
+ radio24.Location = new Point(10, 80);\r
+\r
+ radio31.Location = new Point(10, 20);\r
+ radio32.Location = new Point(10, 40);\r
+ radio33.Location = new Point(10, 60);\r
+ radio34.Location = new Point(10, 80);\r
+\r
+ text1.Size = new Size(150, text1.PreferredHeight);\r
+\r
+ radio11.Size = new Size(150, 20);\r
+ radio12.Size = new Size(150, 20);\r
+ radio13.Size = new Size(150, 20);\r
+ radio14.Size = new Size(150, 20);\r
+\r
+ radio21.Size = new Size(150, 20);\r
+ radio22.Size = new Size(150, 20);\r
+ radio23.Size = new Size(150, 20);\r
+ radio24.Size = new Size(150, 20);\r
+\r
+ radio31.Size = new Size(150, 20);\r
+ radio32.Size = new Size(150, 20);\r
+ radio33.Size = new Size(150, 20);\r
+ radio34.Size = new Size(150, 20);\r
+\r
+ group1.Controls.Add(text1);\r
+\r
+ group1.Controls.Add(radio11);\r
+ group1.Controls.Add(radio12);\r
+ group1.Controls.Add(radio13);\r
+ group1.Controls.Add(radio14);\r
+\r
+ group2.Controls.Add(radio21);\r
+ group2.Controls.Add(radio22);\r
+ group2.Controls.Add(radio23);\r
+ group2.Controls.Add(radio24);\r
+\r
+ group3.Controls.Add(radio31);\r
+ group3.Controls.Add(radio32);\r
+ group3.Controls.Add(radio33);\r
+ group3.Controls.Add(radio34);\r
+\r
+ form.Controls.Add(group1);\r
+ form.Controls.Add(group2);\r
+ group2.Controls.Add(group3);\r
+\r
+ // Perform some tests, the TabIndex stuff below will alter the outcome
+ Assert.AreEqual(null, TestControl(group2, radio34, true), "Tab8");\r
+ Assert.AreEqual(31, group2.TabIndex, "Tab9");\r
+
+ // Does the taborder of containers and non-selectable things change behaviour?
+ label1.TabIndex = 5;
+ label2.TabIndex = 4;
+ group1.TabIndex = 3;
+ group2.TabIndex = 1;
+
+ // Start verification\r
+ Assert.AreEqual(null, TestControl(group2, radio34, true), "Tab10");\r
+ Assert.AreEqual(radio24.Text, TestControl(group2, group2, true), "Tab11");\r
+ Assert.AreEqual(radio31.Text, TestControl(group2, group3, true), "Tab12");\r
+ Assert.AreEqual(null, TestControl(group1, radio14, true), "Tab13");\r
+ Assert.AreEqual(radio23.Text, TestControl(group2, radio24, true), "Tab14");\r
+ Assert.AreEqual(group3.Text, TestControl(group2, radio21, true), "Tab15");\r
+ Assert.AreEqual(radio13.Text, TestControl(form, radio12, true), "Tab16");\r
+ Assert.AreEqual(label2.Text, TestControl(form, radio14, true), "Tab17");\r
+ Assert.AreEqual(group1.Text, TestControl(form, radio34, true), "Tab18");\r
+ Assert.AreEqual(radio23.Text, TestControl(group2, radio24, true), "Tab19");\r
+\r
+ // Sanity checks\r
+ Assert.AreEqual(null, TestControl(radio11, radio21, true), "Tab20");\r
+ Assert.AreEqual(text1.Text, TestControl(group1, radio21, true), "Tab21");\r
+\r
+ Assert.AreEqual(radio14.Text, TestControl(form, label2, false), "Tab22");\r
+ Assert.AreEqual(radio21.Text, TestControl(group2, group3, false), "Tab23");\r
+\r
+ Assert.AreEqual(4, radio21.TabIndex, "Tab24");\r
+ Assert.AreEqual(1, radio11.TabIndex, "Tab25");\r
+ Assert.AreEqual(3, radio13.TabIndex, "Tab26");\r
+ Assert.AreEqual(35, group3.TabIndex, "Tab27");\r
+ Assert.AreEqual(1, group2.TabIndex, "Tab28");\r
+\r
+ Assert.AreEqual(label1.Text, TestControl(form, form, false), "Tab29");\r
+ Assert.AreEqual(radio14.Text, TestControl(group1, group1, false), "Tab30");\r
+ Assert.AreEqual(radio34.Text, TestControl(group3, group3, false), "Tab31");\r
+\r
+ Assert.AreEqual(null, TestControl(label1, label1, false), "Tab31");\r
+ Assert.AreEqual(null, TestControl(radio11, radio21, false), "Tab32");\r
+ }\r
+\r
+ [Test]\r
+ public void ScaleTest()\r
+ {\r
+ Control r1 = new Control();\r
+\r
+ r1.Width = 40;\r
+ r1.Height = 20;\r
+ r1.Scale(2);\r
+ Assert.AreEqual(80, r1.Width, "Scale1");\r
+ Assert.AreEqual(40, r1.Height, "Scale2");\r
+ }\r
+\r
+ [Test]\r
+ public void TextTest()\r
+ {\r
+ Control r1 = new Control();\r
+ r1.Text = "Hi" ;\r
+ Assert.AreEqual("Hi" , r1.Text , "Text1");\r
+\r
+ r1.ResetText();\r
+ Assert.AreEqual("" , r1.Text , "Text2");\r
+ }\r
+\r
+ [Test]\r
+ public void PubMethodTest7()\r
+ {\r
+ Control r1 = new Control();\r
+ r1.RightToLeft = RightToLeft.Yes ;\r
+ r1.ResetRightToLeft() ;\r
+ Assert.AreEqual(RightToLeft.No , r1.RightToLeft , "#81");\r
+ r1.ImeMode = ImeMode.Off ;\r
+ r1.ResetImeMode () ;\r
+ Assert.AreEqual(ImeMode.NoControl , r1.ImeMode , "#82");\r
+ r1.ForeColor= SystemColors.GrayText ;\r
+ r1.ResetForeColor() ;\r
+ Assert.AreEqual(SystemColors.ControlText , r1.ForeColor , "#83");\r
+ //r1.Font = Font.FromHdc();\r
+ r1.ResetFont () ;\r
+ //Assert.AreEqual(FontFamily.GenericSansSerif , r1.Font , "#83");\r
+ r1.Cursor = Cursors.Hand ;\r
+ r1.ResetCursor () ;\r
+ Assert.AreEqual(Cursors.Default , r1.Cursor , "#83");\r
+ //r1.DataBindings = System.Windows.Forms.Binding ;\r
+ //r1.ResetBindings() ;\r
+ //Assert.AreEqual(ControlBindingsCollection , r1.DataBindings , "#83");\r
+ r1.BackColor = System.Drawing.Color.Black ;\r
+ r1.ResetBackColor() ;\r
+ Assert.AreEqual( SystemColors.Control , r1.BackColor , "#84");\r
+ r1.BackColor = System.Drawing.Color.Black ;\r
+ r1.Refresh() ;\r
+ Assert.AreEqual( null , r1.Region , "#85");\r
+ Rectangle M = new Rectangle(10, 20, 30 ,40);\r
+ r1.RectangleToScreen(M) ;\r
+ Assert.AreEqual( null , r1.Region , "#86");\r
+\r
+ }\r
+\r
+ [Test]\r
+ public void ScreenClientCoords()\r
+ {\r
+ Label l;\r
+ Point p1;\r
+ Point p2;\r
+ Point p3;\r
+\r
+ l = new Label();\r
+ l.Left = 10;\r
+ l.Top = 12;\r
+ l.Visible = true;\r
+ p1 = new Point (10,10);\r
+ p2 = l.PointToScreen(p1);\r
+ p3 = l.PointToClient(p2);\r
+\r
+ Assert.AreEqual (p1, p3, "SC1");\r
+ }\r
+\r
+ [Test]\r
+ public void ContainsTest ()\r
+ {\r
+ Control t = new Control ();\r
+ Control s = new Control ();\r
+\r
+ t.Controls.Add (s);\r
+\r
+ Assert.AreEqual (true, t.Contains (s), "Con1");\r
+ Assert.AreEqual (false, s.Contains (t), "Con2");\r
+ Assert.AreEqual (false, s.Contains (null), "Con3");\r
+ Assert.AreEqual (false, t.Contains (new Control ()), "Con4");\r
+ }\r
+\r
+ [Test]\r
+ public void CreateHandleTest ()\r
+ {\r
+ Control parent;\r
+ Control child;\r
+\r
+ parent = null;\r
+ child = null;\r
+\r
+ try {\r
+ parent = new Control ();\r
+ child = new Control ();\r
+\r
+ parent.Visible = true;\r
+ parent.Controls.Add (child);\r
+\r
+ Assert.IsFalse (parent.IsHandleCreated, "CH1");\r
+ Assert.IsFalse (child.IsHandleCreated, "CH2");\r
+\r
+ parent.CreateControl ();\r
+ Assert.IsNotNull (parent.Handle, "CH3");\r
+ Assert.IsNotNull (child.Handle, "CH4");\r
+ Assert.IsTrue (parent.IsHandleCreated, "CH5");\r
+ Assert.IsTrue (child.IsHandleCreated, "CH6");\r
+ } finally {\r
+ if (parent != null)\r
+ parent.Dispose ();\r
+ if (child != null)\r
+ child.Dispose ();\r
+ }\r
+\r
+ // Accessing Handle Property creates the handle\r
+ try {\r
+ parent = new Control ();\r
+ parent.Visible = true;\r
+ child = new Control ();\r
+ parent.Controls.Add (child);\r
+ Assert.IsFalse (parent.IsHandleCreated, "CH7");\r
+ Assert.IsFalse (child.IsHandleCreated, "CH8");\r
+ Assert.IsNotNull (parent.Handle, "CH9");\r
+ Assert.IsTrue (parent.IsHandleCreated, "CH10");\r
+ Assert.IsTrue (child.IsHandleCreated, "CH11");\r
+ } finally {\r
+ if (parent != null)\r
+ parent.Dispose ();\r
+ if (child != null)\r
+ child.Dispose ();\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ public void CreateGraphicsTest ()\r
+ {\r
+ Graphics g = null;\r
+ Pen p = null;\r
+\r
+ try {\r
+ Control c = new Control ();\r
+ c.SetBounds (0,0, 20, 20);\r
+ g = c.CreateGraphics ();\r
+ Assert.IsNotNull (g, "Graph1");\r
+ } finally {\r
+ if (p != null)\r
+ p.Dispose ();\r
+ if (g != null)\r
+ g.Dispose ();\r
+ }\r
+ }\r
+\r
+ bool delegateCalled = false;\r
+ public delegate void TestDelegate ();\r
+\r
+ [Test]\r
+ [ExpectedException(typeof(System.InvalidOperationException))]\r
+ public void InvokeException1 () {\r
+ Control c = new Control ();\r
+ IAsyncResult result;\r
+\r
+ result = c.BeginInvoke (new TestDelegate (delegate_call));\r
+ c.EndInvoke (result);\r
+ }\r
+\r
+ [Test]\r
+ public void InvokeTest () {\r
+ Control c = null;\r
+\r
+ try {\r
+ c = new Control ();\r
+ IAsyncResult result;\r
+\r
+ c.CreateControl ();\r
+ result = c.BeginInvoke (new TestDelegate (delegate_call));\r
+ c.EndInvoke (result);\r
+ Assert.AreEqual (true, delegateCalled, "Invoke1");\r
+ } finally {\r
+ if (c != null)\r
+ c.Dispose ();\r
+ }\r
+ }\r
+\r
+ public void delegate_call () {\r
+ delegateCalled = true;\r
+ }\r
+\r
+ [Test]\r
+ public void FindFormTest () {\r
+ Form f = new Form ();\r
+\r
+ f.Name = "form";\r
+ Control c = null;\r
+\r
+ try {\r
+ f.Controls.Add (c = new Control ());\r
+ Assert.AreEqual (f.Name, c.FindForm ().Name, "Find1");\r
+\r
+ f.Controls.Remove (c);\r
+\r
+ GroupBox g = new GroupBox ();\r
+ g.Name = "box";\r
+ f.Controls.Add (g);\r
+ g.Controls.Add (c);\r
+\r
+ Assert.AreEqual (f.Name, f.FindForm ().Name, "Find2");\r
+\r
+ g.Controls.Remove (c);\r
+ Assert.IsNull(c.FindForm (), "Find3");\r
+\r
+ } finally {\r
+ if (c != null)\r
+ c.Dispose ();\r
+ if (f != null)\r
+ f.Dispose ();\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ public void FocusTest ()\r
+ {\r
+ Form f = null;\r
+ Button c = null, d = null;\r
+\r
+ try {\r
+ f = new Form ();\r
+ f.Visible = true;\r
+ c = new Button ();\r
+ c.Visible = true;\r
+ f.Controls.Add (c);\r
+\r
+ d = new Button ();\r
+ d.Visible = false;\r
+ f.Controls.Add (d);\r
+\r
+ Assert.IsTrue (c.CanFocus, "Focus1");\r
+ Assert.IsFalse (c.Focused, "Focus2");\r
+ c.Focus ();\r
+ Assert.IsTrue (c.Focused, "Focus3");\r
+ d.Focus ();\r
+ Assert.IsFalse (d.Focused, "Focus4");\r
+\r
+ d.Visible = true;\r
+ d.Focus ();\r
+ Assert.IsTrue (d.Focused, "Focus5");\r
+ Assert.IsFalse (c.Focused, "Focus6");\r
+\r
+ c.Enabled = false;\r
+ Assert.IsFalse (c.Focused, "Focus7");\r
+ } finally {\r
+ if (f != null)\r
+ f.Dispose ();\r
+ if (c != null)\r
+ c.Dispose ();\r
+ if (d != null)\r
+ d.Dispose ();\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ public void FromHandleTest ()\r
+ {\r
+ Control c1 = null;\r
+ Control c2 = null;\r
+\r
+ try {\r
+ c1 = new Control ();\r
+ c2 = new Control ();\r
+\r
+ c1.Name = "parent";\r
+ c2.Name = "child";\r
+ c1.Controls.Add(c2);\r
+\r
+ // Handle\r
+ Assert.AreEqual (c1.Name, Control.FromHandle (c1.Handle).Name, "Handle1");\r
+ Assert.IsNull (Control.FromHandle (IntPtr.Zero), "Handle2");\r
+\r
+ // ChildHandle\r
+ Assert.AreEqual (c1.Name, Control.FromChildHandle (c1.Handle).Name, "Handle3");\r
+ Assert.IsNull (Control.FromChildHandle (IntPtr.Zero), "Handle4");\r
+\r
+\r
+ } finally {\r
+ if (c1 != null)\r
+ c1.Dispose ();\r
+\r
+ if (c2 != null)\r
+ c2.Dispose ();\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ public void GetChildAtPointTest ()\r
+ {\r
+ Control c = null, d = null, e = null;\r
+\r
+ try {\r
+ c = new Control ();\r
+ c.Name = "c1";\r
+ c.SetBounds (0, 0, 100, 100);\r
+\r
+ d = new Control ();\r
+ d.Name = "d1";\r
+ d.SetBounds (10, 10, 40, 40);\r
+ c.Controls.Add (d);\r
+\r
+ e = new Control ();\r
+ e.Name = "e1";\r
+ e.SetBounds (55, 55, 10, 10);\r
+\r
+ Control l = c.GetChildAtPoint (new Point (15, 15));\r
+ Assert.AreEqual (d.Name, l.Name, "Child1");\r
+ Assert.IsFalse (e.Name == l.Name, "Child2");\r
+\r
+ l = c.GetChildAtPoint (new Point (57, 57));\r
+ Assert.IsNull (l, "Child3");\r
+\r
+ l = c.GetChildAtPoint (new Point (10, 10));\r
+ Assert.AreEqual (d.Name, l.Name, "Child4");\r
+\r
+ #if NET_2_0\r
+ c.Controls.Add (e);\r
+ e.Visible = false;\r
+ l = c.GetChildAtPoint (new Point (57, 57), GetChildAtPointSkip.Invisible);\r
+ Assert.IsNull (l, "Child5");\r
+\r
+ e.Visible = true;\r
+ l = c.GetChildAtPoint (new Point (57, 57), GetChildAtPointSkip.Invisible);\r
+ Assert.AreSame (e.Name, l.Name, "Child6");\r
+ #endif // NET_2_0 \r
+ } finally {\r
+ if (c != null)\r
+ c.Dispose ();\r
+ if (d != null)\r
+ d.Dispose ();\r
+ }\r
+ }\r
}\r
- [Test]\r
- public void PubMethodTest5()\r
- {\r
- Control r1 = new Control();\r
- r1.Width = 40;\r
- r1.Height = 20;\r
- r1.Scale(2);\r
- Assert.AreEqual(80, r1.Width, "#78");\r
- Assert.AreEqual(40, r1.Height, "#79");\r
- }\r
- \r
- [Test]\r
- public void PubMethodTest6()\r
- {\r
- Control r1 = new Control();\r
- r1.Text = "Hi" ;\r
- r1.ResetText();\r
- Assert.AreEqual("" , r1.Text , "#80");\r
- }\r
- \r
- [Test]\r
- public void PubMethodTest7()\r
- {\r
- Control r1 = new Control();\r
- r1.RightToLeft = RightToLeft.Yes ;\r
- r1.ResetRightToLeft() ;\r
- Assert.AreEqual(RightToLeft.No , r1.RightToLeft , "#81");\r
- r1.ImeMode = ImeMode.Off ;\r
- r1.ResetImeMode () ;\r
- Assert.AreEqual(ImeMode.NoControl , r1.ImeMode , "#82");\r
- r1.ForeColor= SystemColors.GrayText ;\r
- r1.ResetForeColor() ;\r
- Assert.AreEqual(SystemColors.ControlText , r1.ForeColor , "#83");\r
- //r1.Font = Font.FromHdc();\r
- r1.ResetFont () ;\r
- //Assert.AreEqual(FontFamily.GenericSansSerif , r1.Font , "#83");\r
- r1.Cursor = Cursors.Hand ;\r
- r1.ResetCursor () ;\r
- Assert.AreEqual(Cursors.Default , r1.Cursor , "#83");\r
- //r1.DataBindings = System.Windows.Forms.Binding ;\r
- //r1.ResetBindings() ;\r
- //Assert.AreEqual(ControlBindingsCollection , r1.DataBindings , "#83");\r
- r1.BackColor = System.Drawing.Color.Black ;\r
- r1.ResetBackColor() ;\r
- Assert.AreEqual( SystemColors.Control , r1.BackColor , "#84");\r
- r1.BackColor = System.Drawing.Color.Black ;\r
- r1.Refresh() ;\r
- Assert.AreEqual( null , r1.Region , "#85");\r
- Rectangle M = new Rectangle(10, 20, 30 ,40);\r
- r1.RectangleToScreen(M) ;\r
- Assert.AreEqual( null , r1.Region , "#86");\r
- \r
- }\r
- \r
- [Test]\r
- public void PubMethodTest8()\r
- {\r
- Label N = new Label();\r
- N.Left = 10;\r
- N.Top = 12;\r
- N.Visible = true;\r
- Point p = new Point (10,10);\r
- Point p1 = N.PointToScreen(p) ;\r
- Point p2 = N.PointToClient (p1);\r
- Assert.AreEqual (p, p2, "#1 converting client->screen->client should not loose data");\r
-\r
- }\r
- \r
- [Test]\r
- public void ContainsTest ()\r
- {\r
- Control t = new Control ();\r
- Control s = new Control ();\r
- t.Controls.Add (s);\r
-\r
- Assert.AreEqual (true, t.Contains (s), "#1 should contain");\r
- Assert.AreEqual (false, s.Contains (t), "#2 should not contain");\r
- Assert.AreEqual (false, s.Contains (null), "#3 should not contain");\r
- Assert.AreEqual (false, t.Contains (new Control ()), "#4 should not contain");\r
- }\r
-\r
- [Test]\r
- public void CreateHandleTest ()\r
- {\r
- Control parent = null, child = null;\r
- try {\r
- parent = new Control ();\r
- parent.Visible = true;\r
- child = new Control ();\r
- parent.Controls.Add (child);\r
-\r
- Assert.IsFalse (parent.IsHandleCreated, "#1 handle should not be created while ctor");\r
- Assert.IsFalse (child.IsHandleCreated, "#2 handle should not be created while ctor");\r
-\r
- parent.CreateControl ();\r
- Assert.IsNotNull (parent.Handle, "#3 should create a handle");\r
- Assert.IsNotNull (child.Handle, "#4 should create a handle");\r
- Assert.IsTrue (parent.IsHandleCreated, "#5 should have created handle");\r
- Assert.IsTrue (child.IsHandleCreated, "#6 should have created handle");\r
- } finally {\r
- if (parent != null)\r
- parent.Dispose ();\r
- if (child != null)\r
- child.Dispose ();\r
- }\r
-\r
- // Accessing Handle Property creates the handle\r
- try {\r
- parent = new Control ();\r
- parent.Visible = true;\r
- child = new Control ();\r
- parent.Controls.Add (child);\r
- Assert.IsFalse (parent.IsHandleCreated, "#7 handle is not created while ctor");\r
- Assert.IsFalse (child.IsHandleCreated, "#8 handle is not created while ctor");\r
- Assert.IsNotNull (parent.Handle, "#9 should create a handle");\r
- Assert.IsTrue (parent.IsHandleCreated, "#10 should have created handle");\r
- Assert.IsTrue (child.IsHandleCreated, "#11 should have created handle");\r
- } finally {\r
- if (parent != null)\r
- parent.Dispose ();\r
- if (child != null)\r
- child.Dispose ();\r
- }\r
- }\r
-\r
- [Test]\r
- public void CreateGraphicsTest ()\r
- {\r
- Graphics g = null;\r
- Pen p = null;\r
- try {\r
- Control c = new Control ();\r
- c.SetBounds (0,0, 20, 20);\r
- g = c.CreateGraphics ();\r
- Assert.IsNotNull (g, "#1 should create a graphics object");\r
- g.DrawLine (p = new Pen (Color.Red), 10, 10, 20, 20);\r
- } finally {\r
- if (p != null)\r
- p.Dispose ();\r
- if (g != null)\r
- g.Dispose ();\r
- }\r
- }\r
-\r
- bool delegateCalled = false;\r
- public delegate void TestDelegate ();\r
-\r
- [Test]\r
- public void InvokeTest ()\r
- {\r
- Control c = null;\r
- try {\r
- c = new Control ();\r
- IAsyncResult result;\r
- try {\r
- result = c.BeginInvoke (new TestDelegate (delegate_call));\r
- c.EndInvoke (result);\r
- Assert.Fail ("#1 should not invoke without window handle");\r
- } catch (InvalidOperationException) { }\r
- c.CreateControl ();\r
- result = c.BeginInvoke (new TestDelegate (delegate_call));\r
- c.EndInvoke (result);\r
-\r
- Assert.IsTrue (delegateCalled, "#1 value should have been set to true");\r
- } finally {\r
- if (c != null)\r
- c.Dispose ();\r
- }\r
- }\r
-\r
- public void delegate_call ()\r
- {\r
- delegateCalled = true;\r
- }\r
-\r
- [Test]\r
- public void FindFormTest ()\r
- {\r
- Form f = new Form ();\r
- f.Name = "form";\r
- Control c = null;\r
- try {\r
- f.Controls.Add (c = new Control ());\r
- Assert.AreEqual (f.Name, c.FindForm ().Name, "#1 should find the parent form");\r
-\r
- f.Controls.Remove (c);\r
-\r
- GroupBox g = new GroupBox ();\r
- g.Name = "box";\r
- f.Controls.Add (g);\r
- g.Controls.Add (c);\r
-\r
- Assert.AreEqual (f.Name, f.FindForm ().Name, "#2 still should find the form");\r
-\r
- g.Controls.Remove (c);\r
- Assert.IsNull(c.FindForm (), "#3 should be null");\r
-\r
- } finally {\r
- if (c != null)\r
- c.Dispose ();\r
- if (f != null)\r
- f.Dispose ();\r
- }\r
- }\r
-\r
- [Test]\r
- public void FocusTest ()\r
- {\r
- Form f = null;\r
- Button c = null, d = null;\r
- try {\r
- f = new Form ();\r
- f.Visible = true;\r
- c = new Button ();\r
- c.Visible = true;\r
- f.Controls.Add (c);\r
- \r
- d = new Button ();\r
- d.Visible = false;\r
- f.Controls.Add (d);\r
- \r
- Assert.IsTrue (c.CanFocus, "#1 button should be able to be focused");\r
- Assert.IsFalse (c.Focused, "#2 button should not be focussed initially");\r
- c.Focus ();\r
- Assert.IsTrue (c.Focused, "#3 button should be focussed after Focus ()");\r
- d.Focus ();\r
- Assert.IsFalse (d.Focused, "#4 invisible button should not be focussed");\r
-\r
- d.Visible = true;\r
- d.Focus ();\r
- Assert.IsTrue (d.Focused, "#5 button should be focussed after Focus () & visible");\r
- Assert.IsFalse (c.Focused, "#6 button should lost focus");\r
-\r
- c.Enabled = false;\r
- Assert.IsFalse (c.Focused, "#7 disabled button should not be focused");\r
- } finally {\r
- if (f != null)\r
- f.Dispose ();\r
- if (c != null)\r
- c.Dispose ();\r
- if (d != null)\r
- d.Dispose ();\r
- }\r
- }\r
-\r
- [Test]\r
- public void FromChildHandleTest ()\r
- {\r
- // FIXME : how to make a control to have more than one handle?\r
- Control c = null;\r
- try {\r
- c = new Control ();\r
- c.Name = "hello";\r
- IntPtr handle = c.Handle;\r
- Assert.AreEqual (c.Name, Control.FromChildHandle (handle).Name, "#1 handle should be able to relate to control");\r
-\r
- handle = IntPtr.Zero;\r
- Assert.IsNull (Control.FromChildHandle (handle), "#2 should return null");\r
- } finally {\r
- if (c != null)\r
- c.Dispose ();\r
- }\r
- }\r
-\r
- [Test]\r
- public void FromHandleTest ()\r
- {\r
- Control c = null;\r
- try {\r
- c = new Control ();\r
- c.Name = "hello";\r
- IntPtr handle = c.Handle;\r
- Assert.AreEqual (c.Name, Control.FromHandle (handle).Name, "#1 handle should be able to relate to control");\r
-\r
- handle = IntPtr.Zero;\r
- Assert.IsNull (Control.FromHandle (handle), "#2 should return null");\r
- } finally {\r
- if (c != null)\r
- c.Dispose ();\r
- }\r
- }\r
-\r
- [Test]\r
- public void GetChildAtPointTest ()\r
- {\r
- Control c = null, d = null, e = null;\r
- try {\r
- c = new Control ();\r
- c.Name = "c1";\r
- c.SetBounds (0, 0, 100, 100);\r
-\r
- d = new Control ();\r
- d.Name = "d1";\r
- d.SetBounds (10, 10, 40, 40);\r
- c.Controls.Add (d);\r
-\r
- e = new Control ();\r
- e.Name = "e1";\r
- e.SetBounds (55, 55, 10, 10);\r
-\r
- Control l = c.GetChildAtPoint (new Point (15, 15));\r
- Assert.AreEqual (d.Name, l.Name, "#1 should return the cild");\r
- Assert.IsFalse (e.Name == l.Name, "#2 e is not child of c");\r
-\r
- l = c.GetChildAtPoint (new Point (57, 57));\r
- Assert.IsNull (l, "#3 no control at 55");\r
-\r
- l = c.GetChildAtPoint (new Point (10, 10));\r
- Assert.AreEqual (d.Name, l.Name, "#4 should return the child even if it falls on border");\r
-\r
- /* net 2.0 overload\r
-#if NET_2_0\r
- c.Controls.Add (e);\r
- e.Visible = false;\r
- l = c.GetChildAtPoint (new Point (57, 57), GetChildAtPointSkip.Invisible);\r
- Assert.IsNull (l, "#4 should ignore of type invisible");\r
-\r
- e.Visible = true;\r
- l = c.GetChildAtPoint (new Point (57, 57), GetChildAtPointSkip.Invisible);\r
- Assert.AreSame (e.Name, l.Name, "#4 should show visible controls");\r
-#endif // NET_2_0 \r
- */\r
- } finally {\r
- if (c != null)\r
- c.Dispose ();\r
- if (d != null)\r
- d.Dispose ();\r
- }\r
- }\r
-\r
- }\r
+}
\ No newline at end of file