コード例 #1
0
        public void ClearTest()
        {
            D2DViewControl target = CreateD2DViewControl();

            target.AddViewControl(CreateD2DViewControl());
            target.AddViewControl(CreateD2DViewControl());
            target.Clear();

            Assert.AreEqual(0, target.ViewControls.Count);
        }
コード例 #2
0
        public void AddViewControlTest()
        {
            D2DViewControl target = CreateD2DViewControl();
            var            add    = CreateD2DViewControl();

            target.AddViewControl(add);
            Assert.AreSame(add, target.ViewControls[0]);
        }
コード例 #3
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);
        }