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