public void GetEnumerator_WithChildren_EnumeratorMatchesChildren() { CanvasContainer container = new CanvasContainer(); CanvasObject co = new ButtonObject(); container.Add(co); Assert.AreEqual(1, container.Count()); }
public void Draw_WithChildren_DrawForwarded() { CanvasContainer container = new CanvasContainer(); DummyObject co = new DummyObject(); container.Add(co); container.Draw(null, null); Assert.AreEqual(1, co.drawCount); }
public void Add_Child_ChildAddedCollectionChangedTriggered() { int collectionChangedCount = 0; CanvasContainer container = new CanvasContainer(); container.CollectionChanged += (sender, e) => collectionChangedCount++; CanvasObject co = new ButtonObject(); container.Add(co); Assert.AreEqual(1, collectionChangedCount); Assert.AreEqual(1, container.Count); }
public void Clear_Existing_AllChildRemoved() { int collectionChangedCount = 0; CanvasContainer container = new CanvasContainer(); CanvasObject co = new ButtonObject(); container.Add(co); container.CollectionChanged += (sender, e) => collectionChangedCount++; container.Clear(); Assert.AreEqual(1, collectionChangedCount); Assert.AreEqual(0, container.Count); }
public void Add_ChildRedraw_RedrawForwarded() { int redrawCount = 0; CanvasContainer container = new CanvasContainer(); container.RedrawEvent += (c, area) => redrawCount++; CanvasObject co = new ButtonObject(); container.Add(co); co.ReDraw(); Assert.AreEqual(1, redrawCount); }