Example #1
0
		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);
		}
Example #2
0
        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);
        }
Example #3
0
		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));
		}
Example #4
0
        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));
        }
Example #5
0
        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);
        }
Example #6
0
		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);
		}