public void UniqueID1() { // Standalone NC Control nc = new MyNC(); Assert.IsNull(nc.UniqueID, "nulltest"); }
public void UniqueID4() { // NC in control Control control = new Control(); Control nc = new MyNC(); nc.Controls.Add(control); Assert.IsNotNull(control.UniqueID, "notnull"); }
public void UniqueID3() { // NC in control Control control = new Control(); Control nc = new MyNC(); control.Controls.Add(nc); Assert.IsNull(nc.UniqueID, "null"); }
public void UniqueID1_1() { // Standalone NC Control nc = new MyNC(); Page p = new Page(); p.Controls.Add(nc); Assert.IsNotNull(nc.UniqueID, "notnull"); }
public void UniqueID2() { // NC in NC Control nc = new MyNC(); Control nc2 = new MyNC(); nc2.Controls.Add(nc); Assert.IsNotNull(nc.UniqueID, "notnull"); Assert.IsTrue(nc.UniqueID.IndexOfAny(new char[] { ':', '$' }) == -1, "separator"); }
public void DataBind() { MyNC ctrl = new MyNC(); ctrl.DataBinding += new EventHandler(ctrl_DataBinding); Assert.AreEqual(false, _eventDataBinding, "Before DataBinding"); ctrl.DataBind(false); Assert.AreEqual(false, _eventDataBinding, "Before DataBinding"); ctrl.DataBind(true); Assert.AreEqual(true, _eventDataBinding, "After DataBinding"); }
public void UniqueID6() { // NC in NC Control nc = new MyNC(); Page p = new Page(); p.Controls.Add(nc); Assert.IsNotNull(nc.UniqueID, "notnull"); Control c1 = new Control(); Control c2 = new Control(); nc.Controls.Add(c1); nc.Controls.Add(c2); string uid1_1 = c1.UniqueID; string uid2_1 = c2.UniqueID; nc.Controls.Clear(); Assert.IsNull(c1.UniqueID); Assert.IsNull(c2.UniqueID); // ad in another order nc.Controls.Add(c2); nc.Controls.Add(c1); string uid1_2 = c1.UniqueID; string uid2_2 = c2.UniqueID; Assert.IsFalse(uid1_1 == uid1_2); Assert.IsFalse(uid2_1 == uid2_2); Assert.AreEqual(uid1_1, uid2_2); Assert.AreEqual(uid2_1, uid1_2); nc.Controls.Remove(c1); nc.Controls.Add(c1); string uid1_3 = c1.UniqueID; Assert.IsFalse(uid1_3 == uid1_2, "id was not reset"); #if NET_2_0 EnsureIDControl c3 = new EnsureIDControl(); nc.Controls.Add(c3); string uid3_1 = c3.UniqueID; c3.DoEnsureID(); Assert.IsNotNull(c3.ID); nc.Controls.Remove(c3); nc.Controls.Add(c3); string uid3_2 = c3.UniqueID; Assert.IsNull(c3.ID); Assert.IsFalse(uid3_1 == uid3_2, "id was not reset"); #endif }
public void UniqueID5() { // NC in control Control control = new Control(); Control nc = new MyNC(); Control nc2 = new MyNC(); nc2.Controls.Add(nc); nc.Controls.Add(control); Assert.IsNotNull(control.UniqueID, "notnull"); Assert.IsNull(nc2.ID, "null-1"); Assert.IsNull(nc.ID, "null-2"); Assert.IsTrue(-1 != control.UniqueID.IndexOfAny(new char[] { ':', '$' }), "separator"); }
public void HasEvent() { MyNC ctrl1 = new MyNC(); Assert.AreEqual(false, ctrl1.HasEvents(), "HasEvent#1"); EventHandler ctrl_hdlr = new EventHandler(ctrl1_Init); ctrl1.Init += new EventHandler(ctrl1_Init); ctrl1.Init += ctrl_hdlr; Assert.AreEqual(true, ctrl1.HasEvents(), "HasEvent#2"); // Dosn't work than removed handler //ctrl1.Init -= ctrl_hdlr; //Assert.AreEqual (false, ctrl1.HasEvents (), "HasEvent#3"); }
public void NameIsUniqueID() { ListBoxPoker list = new ListBoxPoker(); Page page = new Page(); page.ID = "pg"; Control ctrl = new MyNC(); ctrl.ID = "ctrl"; page.Controls.Add(ctrl); ctrl.Controls.Add(list); string str = list.Render(); Assert.IsTrue(-1 != list.Render().IndexOf(':'), "unique"); }
public void DataBindChildren() { MyNC ctrl1 = new MyNC(); Control ctrl2 = new Control(); Control ctrl3 = new Control(); ctrl2.DataBinding += new EventHandler(ctrl2_DataBinding); ctrl3.DataBinding += new EventHandler(ctrl3_DataBinding); ctrl2.Controls.Add(ctrl3); ctrl1.Controls.Add(ctrl2); Assert.AreEqual(false, _eventChild1, "Before DataBinding#1"); Assert.AreEqual(false, _eventChild2, "Before DataBinding#2"); ctrl1.DataBindChildren(); Assert.AreEqual(true, _eventChild1, "After DataBinding#1"); Assert.AreEqual(true, _eventChild2, "After DataBinding#2"); }
public void ClientID() { // NC in control Control control = new Control(); Control nc = new MyNC(); Control nc2 = new MyNC(); Control nc3 = new MyNC(); nc3.Controls.Add(nc2); nc2.Controls.Add(nc); nc.Controls.Add(control); #if NET_2_0 string expected = "ctl00_ctl00_ctl00"; #else string expected = "_ctl0__ctl0__ctl0"; #endif Assert.AreEqual(expected, control.ClientID, "ClientID"); }
public void EnsureID() { MyNC ctrl = new MyNC(); MyNC ctrl1 = new MyNC(); ctrl.Controls.Add(ctrl1); Page p = new Page(); p.Controls.Add(ctrl); ctrl.EnsureID(); if (String.IsNullOrEmpty(ctrl.ID)) { Assert.Fail("EnsureID#1"); } ctrl1.EnsureID(); if (String.IsNullOrEmpty(ctrl1.ID)) { Assert.Fail("EnsureID#2"); } }
public void DataBindChildren () { MyNC ctrl1 = new MyNC (); Control ctrl2 = new Control (); Control ctrl3 = new Control (); ctrl2.DataBinding += new EventHandler (ctrl2_DataBinding); ctrl3.DataBinding += new EventHandler (ctrl3_DataBinding); ctrl2.Controls.Add (ctrl3); ctrl1.Controls.Add (ctrl2); Assert.AreEqual (false, _eventChild1, "Before DataBinding#1"); Assert.AreEqual (false, _eventChild2, "Before DataBinding#2"); ctrl1.DataBindChildren (); Assert.AreEqual (true, _eventChild1, "After DataBinding#1"); Assert.AreEqual (true, _eventChild2, "After DataBinding#2"); }
public void DataBind () { MyNC ctrl = new MyNC (); ctrl.DataBinding += new EventHandler (ctrl_DataBinding); Assert.AreEqual (false, _eventDataBinding, "Before DataBinding"); ctrl.DataBind (false); Assert.AreEqual (false, _eventDataBinding, "Before DataBinding"); ctrl.DataBind (true); Assert.AreEqual (true, _eventDataBinding, "After DataBinding"); }
public void ClientID () { // NC in control Control control = new Control (); Control nc = new MyNC (); Control nc2 = new MyNC (); Control nc3 = new MyNC (); nc3.Controls.Add (nc2); nc2.Controls.Add (nc); nc.Controls.Add (control); #if NET_2_0 string expected = "ctl00_ctl00_ctl00"; #else string expected = "_ctl0__ctl0__ctl0"; #endif Assert.AreEqual (expected, control.ClientID, "ClientID"); }
public void UniqueID6 () { // NC in NC Control nc = new MyNC (); Page p = new Page (); p.Controls.Add (nc); Assert.IsNotNull (nc.UniqueID, "notnull"); Control c1 = new Control (); Control c2 = new Control (); nc.Controls.Add (c1); nc.Controls.Add (c2); string uid1_1 = c1.UniqueID; string uid2_1 = c2.UniqueID; nc.Controls.Clear (); Assert.IsNull (c1.UniqueID); Assert.IsNull (c2.UniqueID); // ad in another order nc.Controls.Add (c2); nc.Controls.Add (c1); string uid1_2 = c1.UniqueID; string uid2_2 = c2.UniqueID; Assert.IsFalse (uid1_1 == uid1_2); Assert.IsFalse (uid2_1 == uid2_2); Assert.AreEqual (uid1_1, uid2_2); Assert.AreEqual (uid2_1, uid1_2); nc.Controls.Remove (c1); nc.Controls.Add (c1); string uid1_3 = c1.UniqueID; Assert.IsFalse (uid1_3 == uid1_2, "id was not reset"); #if NET_2_0 EnsureIDControl c3 = new EnsureIDControl (); nc.Controls.Add (c3); string uid3_1 = c3.UniqueID; c3.DoEnsureID (); Assert.IsNotNull (c3.ID); nc.Controls.Remove (c3); nc.Controls.Add (c3); string uid3_2 = c3.UniqueID; Assert.IsNull (c3.ID); Assert.IsFalse (uid3_1 == uid3_2, "id was not reset"); #endif }
public void UniqueID5 () { // NC in control Control control = new Control (); Control nc = new MyNC (); Control nc2 = new MyNC (); nc2.Controls.Add (nc); nc.Controls.Add (control); Assert.IsNotNull (control.UniqueID, "notnull"); Assert.IsNull (nc2.ID, "null-1"); Assert.IsNull (nc.ID, "null-2"); Assert.IsTrue (-1 != control.UniqueID.IndexOfAny (new char[] { ':', '$' }), "separator"); }
public void UniqueID4 () { // NC in control Control control = new Control (); Control nc = new MyNC (); nc.Controls.Add (control); Assert.IsNotNull (control.UniqueID, "notnull"); }
public void UniqueID3 () { // NC in control Control control = new Control (); Control nc = new MyNC (); control.Controls.Add (nc); Assert.IsNull (nc.UniqueID, "null"); }
public void UniqueID2_1 () { // NC in NC Control nc = new MyNC (); Control nc2 = new MyNC (); nc2.Controls.Add (nc); Page p = new Page (); p.Controls.Add (nc2); Assert.IsNotNull (nc.UniqueID, "notnull"); Assert.IsTrue (nc.UniqueID.IndexOfAny (new char [] { ':', '$' }) != -1, "separator"); }
public void UniqueID1_1 () { // Standalone NC Control nc = new MyNC (); Page p = new Page (); p.Controls.Add (nc); Assert.IsNotNull (nc.UniqueID, "notnull"); }
public void Control_Adapter () { MyNC ctr = new MyNC (); Assert.AreEqual (null, ctr.Adapter (), "Adapter"); }
public void EnsureID () { MyNC ctrl = new MyNC (); MyNC ctrl1 = new MyNC (); ctrl.Controls.Add (ctrl1); Page p = new Page (); p.Controls.Add (ctrl); ctrl.EnsureID (); if (String.IsNullOrEmpty (ctrl.ID)) Assert.Fail ("EnsureID#1"); ctrl1.EnsureID (); if (String.IsNullOrEmpty (ctrl1.ID)) Assert.Fail ("EnsureID#2"); }
public void HasEvent () { MyNC ctrl1 = new MyNC (); Assert.AreEqual (false, ctrl1.HasEvents (), "HasEvent#1"); EventHandler ctrl_hdlr = new EventHandler (ctrl1_Init); ctrl1.Init += new EventHandler (ctrl1_Init); ctrl1.Init += ctrl_hdlr; Assert.AreEqual (true, ctrl1.HasEvents (), "HasEvent#2"); // Dosn't work than removed handler //ctrl1.Init -= ctrl_hdlr; //Assert.AreEqual (false, ctrl1.HasEvents (), "HasEvent#3"); }
public void UniqueID1 () { // Standalone NC Control nc = new MyNC (); Assert.IsNull (nc.UniqueID, "nulltest"); }
public void NameIsUniqueID () { ListBoxPoker list = new ListBoxPoker (); Page page = new Page (); page.ID = "pg"; Control ctrl = new MyNC (); ctrl.ID = "ctrl"; page.Controls.Add (ctrl); ctrl.Controls.Add (list); string str = list.Render(); Assert.IsTrue (-1 != list.Render ().IndexOf (':'), "unique"); }
public void Control_Adapter() { MyNC ctr = new MyNC(); Assert.AreEqual(null, ctr.Adapter(), "Adapter"); }