コード例 #1
0
        public void MoveTest()
        {
            TestPage samplePage = new TestPage();
            TestIPropertyPageSite testSite = new TestIPropertyPageSite();

            samplePage.SetPageSite(testSite);
            Mocks.TestHostingForm hostingForm = new PropertyPageBaseTest.Mocks.TestHostingForm();
            using (hostingForm)
            {
                hostingForm.CreateControl();
                RECT hostingRectangle;
                hostingRectangle.left = 0;
                hostingRectangle.top = 0;
                hostingRectangle.right = 100;
                hostingRectangle.bottom = 100;
                samplePage.Activate(hostingForm.Handle, new RECT[] { hostingRectangle } , 0);
                hostingRectangle.left = 0;
                hostingRectangle.top = 0;
                hostingRectangle.right = 90;
                hostingRectangle.bottom = 90;
                samplePage.Move(new RECT[] { hostingRectangle });
                TestIPageView pageView = samplePage.MyPageView as TestIPageView;
                Assert.AreEqual(Rectangle.FromLTRB(0, 0, 90, 90), pageView.MyLocation);
            }
        }