Exemplo n.º 1
0
        public void Add_LiteralControl_Literal_And_Control()
        {
            TestTableCell td = new TestTableCell();

            // this is moved into the (empty) Text property
            td.Add(new LiteralControl("Mono2"));
            Assert.IsFalse(td.HasControls(), "HasControls");
            td.Add(new TableCell());
            Assert.AreEqual(2, td.Controls.Count, "NControls");
            Assert.AreEqual(typeof(LiteralControl), td.Controls [0].GetType(), "type 1");
            Assert.AreEqual(typeof(TableCell), td.Controls [1].GetType(), "type 2");
        }
Exemplo n.º 2
0
        public void Add_LiteralControl_NoText()
        {
            TestTableCell td = new TestTableCell();

            // this is moved into the (empty) Text property
            td.Add(new LiteralControl("Mono"));
            Assert.IsFalse(td.HasControls(), "!HasControls");
            Assert.AreEqual("Mono", td.Text, "Text");
            // this replace the current Text property
            td.Add(new LiteralControl("Go Mono"));
            Assert.IsFalse(td.HasControls(), "!HasControls-2");
            Assert.AreEqual("MonoGo Mono", td.Text, "Text-2");
        }
Exemplo n.º 3
0
        public void Add_LiteralControl_Literal_And_Literal()
        {
            TestTableCell td = new TestTableCell();

            // this is moved into the (empty) Text property
            td.Add(new LiteralControl("Mono"));
            Assert.IsFalse(td.HasControls(), "!HasControls");
            Assert.AreEqual("Mono", td.Text, "Text");
            td.Add(new LiteralControl("Mono2"));
            Assert.IsFalse(td.HasControls(), "HasControls-2");
            Assert.AreEqual("MonoMono2", td.Text, "Text");
            Assert.AreEqual(0, td.Controls.Count, "NControls");
        }
Exemplo n.º 4
0
        public void Text_Add_LiteralControl()
        {
            TestTableCell td = new TestTableCell();

            td.Text = "Mono";
            Assert.AreEqual("Mono", td.Text, "Text-1");
            Assert.IsFalse(td.HasControls(), "!HasControls");
            // this replace the current Text property
            td.Add(new LiteralControl("Go Mono"));
            Assert.IsFalse(td.HasControls(), "!HasControls-2");
            Assert.AreEqual("Go Mono", td.Text, "Text-2");
        }
Exemplo n.º 5
0
        public void HasControls_Text()
        {
            TestTableCell td = new TestTableCell();

            for (int i = 0; i < 10; i++)
            {
                td.Add(new Table());
            }
            Assert.AreEqual(10, td.Controls.Count, "10");
            // this removes all existing controls and set the Text property
            td.Text = "Mono";
            Assert.AreEqual("Mono", td.Text, "Text");
            Assert.AreEqual(0, td.Controls.Count, "0");
        }
Exemplo n.º 6
0
        public void Text_Add_Controls()
        {
            TestTableCell td = new TestTableCell();

            td.Text = "Mono";
            Assert.AreEqual("Mono", td.Text, "Text");
            Assert.IsFalse(td.HasControls(), "!HasControls");
            // then add 10 more controls
            for (int i = 0; i < 10; i++)
            {
                td.Add(new Table());
            }
            Assert.AreEqual(11, td.Controls.Count, "11");
            // Text was moved into a LiteralControl
            Assert.IsTrue((td.Controls[0] is LiteralControl), "LiteralControl");
            // and removed from property
            Assert.AreEqual(String.Empty, td.Text, "Test-2");
        }
Exemplo n.º 7
0
		public void Text_Add_Controls ()
		{
			TestTableCell td = new TestTableCell ();
			td.Text = "Mono";
			Assert.AreEqual ("Mono", td.Text, "Text");
			Assert.IsFalse (td.HasControls (), "!HasControls");
			// then add 10 more controls
			for (int i = 0; i < 10; i++)
				td.Add (new Table ());
			Assert.AreEqual (11, td.Controls.Count, "11");
			// Text was moved into a LiteralControl
			Assert.IsTrue ((td.Controls[0] is LiteralControl), "LiteralControl");
			// and removed from property
			Assert.AreEqual (String.Empty, td.Text, "Test-2");
		}
Exemplo n.º 8
0
		public void HasControls_Text ()
		{
			TestTableCell td = new TestTableCell ();
			for (int i = 0; i < 10; i++)
				td.Add (new Table ());
			Assert.AreEqual (10, td.Controls.Count, "10");
			// this removes all existing controls and set the Text property
			td.Text = "Mono";
			Assert.AreEqual ("Mono", td.Text, "Text");
			Assert.AreEqual (0, td.Controls.Count, "0");
		}
Exemplo n.º 9
0
		public void Add_LiteralControl_Literal_And_Control ()
		{
			TestTableCell td = new TestTableCell ();
			// this is moved into the (empty) Text property
			td.Add (new LiteralControl ("Mono2"));
			Assert.IsFalse (td.HasControls (), "HasControls");
			td.Add (new TableCell ());
			Assert.AreEqual (2, td.Controls.Count, "NControls");
			Assert.AreEqual (typeof (LiteralControl), td.Controls [0].GetType (), "type 1");
			Assert.AreEqual (typeof (TableCell), td.Controls [1].GetType (), "type 2");
		}
Exemplo n.º 10
0
		public void Add_LiteralControl_Literal_And_Literal ()
		{
			TestTableCell td = new TestTableCell ();
			// this is moved into the (empty) Text property
			td.Add (new LiteralControl ("Mono"));
			Assert.IsFalse (td.HasControls (), "!HasControls");
			Assert.AreEqual ("Mono", td.Text, "Text");
			td.Add (new LiteralControl ("Mono2"));
			Assert.IsFalse (td.HasControls (), "HasControls-2");
			Assert.AreEqual ("MonoMono2", td.Text, "Text");
			Assert.AreEqual (0, td.Controls.Count, "NControls");
		}
Exemplo n.º 11
0
		public void Add_LiteralControl_Text ()
		{
			TestTableCell td = new TestTableCell ();
			// this is moved into the (empty) Text property
			td.Add (new LiteralControl ("Mono"));
			Assert.IsFalse (td.HasControls (), "!HasControls");
			Assert.AreEqual ("Mono", td.Text, "Text");
			// this replace the current Text property
			td.Text = "Go Mono";
			Assert.IsFalse (td.HasControls (), "!HasControls-2");
			Assert.AreEqual ("Go Mono", td.Text, "Text-2");
		}
Exemplo n.º 12
0
		public void Text_Add_LiteralControl ()
		{
			TestTableCell td = new TestTableCell ();
			td.Text = "Mono";
			Assert.AreEqual ("Mono", td.Text, "Text-1");
			Assert.IsFalse (td.HasControls (), "!HasControls");
			// this replace the current Text property
			td.Add (new LiteralControl ("Go Mono"));
			Assert.IsFalse (td.HasControls (), "!HasControls-2");
			Assert.AreEqual ("Go Mono", td.Text, "Text-2");
		}