public void InvalidAdd3 () { MyContainer co = new MyContainer (); var c1 = new Label ("hi1"); HBox b = new HBox (); b.PackStart (c1); co.Add (c1); }
public void ParentIsSet () { MyContainer co = new MyContainer (); var c1 = new Label ("hi1"); var c2 = new Label ("hi2"); co.Add (c1); co.AddInner (c2); Assert.AreSame (co, c1.Parent); Assert.AreSame (co, c2.Parent); }
public void ChildrenExcludesInternal () { MyContainer co = new MyContainer (); var c1 = new Label ("hi1"); var c2 = new Label ("hi2"); Assert.AreEqual (0, co.Surface.Children.Count ()); co.Add (c1); Assert.AreEqual (1, co.Surface.Children.Count ()); co.AddInner (c2); Assert.AreEqual (2, co.Surface.Children.Count ()); Assert.IsTrue (co.Surface.Children.Contains (c1)); Assert.IsTrue (co.Surface.Children.Contains (c2)); }
public void ChildrenExcludesInternal() { MyContainer co = new MyContainer(); var c1 = new Label("hi1"); var c2 = new Label("hi2"); Assert.AreEqual(0, co.Surface.Children.Count()); co.Add(c1); Assert.AreEqual(1, co.Surface.Children.Count()); co.AddInner(c2); Assert.AreEqual(2, co.Surface.Children.Count()); Assert.IsTrue(co.Surface.Children.Contains(c1)); Assert.IsTrue(co.Surface.Children.Contains(c2)); }
public void Remove() { MyContainer co = new MyContainer(); var c1 = new Label("hi1"); var c2 = new Label("hi2"); co.Add(c1); co.AddInner(c2); Assert.AreEqual(2, co.Surface.Children.Count()); co.RemoveInner(c2); Assert.AreEqual(1, co.Surface.Children.Count()); Assert.IsNull(c2.Parent); co.Remove(c1); Assert.AreEqual(0, co.Surface.Children.Count()); Assert.IsNull(c1.Parent); }
public void InternalRemoveAdd() { // The a child can be removed from internal containers and still // be a child of the container MyContainer co = new MyContainer(); Assert.AreEqual(0, co.Surface.Children.Count()); var c1 = new Label("hi1"); co.Add(c1); Assert.AreEqual(1, co.Surface.Children.Count()); co.InternalRemove(c1); Assert.AreEqual(1, co.Surface.Children.Count()); Assert.AreSame(co, c1.Parent); co.InternalAdd(c1); Assert.AreEqual(1, co.Surface.Children.Count()); Assert.AreSame(co, c1.Parent); }
public void Remove () { MyContainer co = new MyContainer (); var c1 = new Label ("hi1"); var c2 = new Label ("hi2"); co.Add (c1); co.AddInner (c2); Assert.AreEqual (2, co.Surface.Children.Count ()); co.RemoveInner (c2); Assert.AreEqual (1, co.Surface.Children.Count ()); Assert.IsNull (c2.Parent); co.Remove (c1); Assert.AreEqual (0, co.Surface.Children.Count ()); Assert.IsNull (c1.Parent); }
public void InvalidAdd1 () { MyContainer co = new MyContainer (); var c1 = new Label ("hi1"); co.InternalAdd (c1); }
public void InternalRemoveAdd () { // The a child can be removed from internal containers and still // be a child of the container MyContainer co = new MyContainer (); Assert.AreEqual (0, co.Surface.Children.Count ()); var c1 = new Label ("hi1"); co.Add (c1); Assert.AreEqual (1, co.Surface.Children.Count ()); co.InternalRemove (c1); Assert.AreEqual (1, co.Surface.Children.Count ()); Assert.AreSame (co, c1.Parent); co.InternalAdd (c1); Assert.AreEqual (1, co.Surface.Children.Count ()); Assert.AreSame (co, c1.Parent); }
public void InvalidRemove () { MyContainer co = new MyContainer (); var c1 = new Label ("hi1"); co.Add (c1); co.WrongRemove (c1); }