public void ClearTest() { D2DViewControl target = CreateD2DViewControl(); target.AddViewControl(CreateD2DViewControl()); target.AddViewControl(CreateD2DViewControl()); target.Clear(); Assert.AreEqual(0, target.ViewControls.Count); }
public void AddViewControlTest() { D2DViewControl target = CreateD2DViewControl(); var add = CreateD2DViewControl(); target.AddViewControl(add); Assert.AreSame(add, target.ViewControls[0]); }
public void GetAllowedRenderingAreaTest() { D2DViewControl root = CreateD2DViewControl(); root.Bounds = new Rectangle(0, 0, 5, 5); D2DViewControl immediateParent = CreateD2DViewControl(); immediateParent.Bounds = new Rectangle(2, -2, 5, 5); root.AddViewControl(immediateParent); D2DViewControl child = CreateD2DViewControl(); child.Bounds = new Rectangle(-4, 0, 5, 5); immediateParent.AddViewControl(child); Rectangle actual = child.GetAllowedScreenRenderingArea(); Rectangle expected = new Rectangle(4, 2, 1, 3); Assert.AreEqual(expected, actual); }