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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }
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"); }