Exemple #1
0
        public void ListView_AddControlToContainer()
        {
            var     lvp       = new ListViewPoker();
            Control container = new Control();
            Control control   = new Control();

            control.ID = "TestControl";

            lvp.DoAddControlToContainer(control, container, 0);
            Assert.AreEqual(typeof(Control), container.Controls [0].GetType(), "#A1");
            Assert.AreEqual("TestControl", container.Controls [0].ID, "#A2");

            container = new HtmlTable();
            lvp.DoAddControlToContainer(control, container, 0);
            Assert.AreEqual("System.Web.UI.WebControls.ListViewTableRow", container.Controls [0].GetType().ToString(), "#B1");
            Assert.AreEqual("TestControl", container.Controls [0].Controls [0].ID, "#B2");

            container = new HtmlTableRow();
            lvp.DoAddControlToContainer(control, container, 0);
            Assert.AreEqual("System.Web.UI.WebControls.ListViewTableCell", container.Controls [0].GetType().ToString(), "#C1");
            Assert.AreEqual("TestControl", container.Controls [0].Controls [0].ID, "#C2");

            container = new Control();
            lvp.DoAddControlToContainer(control, container, -1);
        }
Exemple #2
0
		public void ListView_AddControlToContainer_NullContainer ()
		{
			var lvp = new ListViewPoker ();
			Control container = new Control ();
			Control control = new Control ();
			control.ID = "TestControl";
			
			lvp.DoAddControlToContainer (control, null, 0);
			Assert.AreEqual (0, container.Controls.Count, "#A2");
		}
Exemple #3
0
		public void ListView_AddControlToContainer ()
		{
			var lvp = new ListViewPoker ();
			Control container = new Control ();
			Control control = new Control ();
			control.ID = "TestControl";

			lvp.DoAddControlToContainer (control, container, 0);
			Assert.AreEqual (typeof (Control), container.Controls [0].GetType (), "#A1");
			Assert.AreEqual ("TestControl", container.Controls [0].ID, "#A2");

			container = new HtmlTable ();
			lvp.DoAddControlToContainer (control, container, 0);
			Assert.AreEqual ("System.Web.UI.WebControls.ListViewTableRow", container.Controls [0].GetType ().ToString (), "#B1");
			Assert.AreEqual ("TestControl", container.Controls [0].Controls [0].ID, "#B2");

			container = new HtmlTableRow ();
			lvp.DoAddControlToContainer (control, container, 0);
			Assert.AreEqual ("System.Web.UI.WebControls.ListViewTableCell", container.Controls [0].GetType ().ToString (), "#C1");
			Assert.AreEqual ("TestControl", container.Controls [0].Controls [0].ID, "#C2");

			container = new Control ();
			lvp.DoAddControlToContainer (control, container, -1);
		}
Exemple #4
0
		public void ListView_AddControlToContainer_NullContainer ()
		{
			var lvp = new ListViewPoker ();
			Control container = new Control ();
			Control control = new Control ();
			control.ID = "TestControl";
			
			lvp.DoAddControlToContainer (control, null, 0);
			Assert.AreEqual (0, container.Controls.Count, "#A2");
		}