Esempio n. 1
0
 private void VerifyOutline(WindowOutline result, float width, float height,
                            SizeF topLeft = new SizeF(), SizeF topRight = new SizeF(), SizeF bottomLeft = new SizeF(), SizeF bottomRight = new SizeF())
 {
     Assert.AreEqual(width, result.Size.Width, DELTA);
     Assert.AreEqual(height, result.Size.Height, DELTA);
     VerifySize(topLeft, result.TopLeft);
     VerifySize(topRight, result.TopRight);
     VerifySize(bottomLeft, result.BottomLeft);
     VerifySize(bottomRight, result.BottomRight);
 }
Esempio n. 2
0
        public void Scale_Test()
        {
            var target = new WindowOutline
            {
                Size        = new SizeF(1000, 2000),
                TopLeft     = new SizeF(10, 20),
                TopRight    = new SizeF(30, 40),
                BottomRight = new SizeF(50, 60),
                BottomLeft  = new SizeF(70, 80)
            };

            var result = target.Scale(2);

            VerifySize(new SizeF(2000, 4000), result.Size);
            VerifySize(new SizeF(20, 40), result.TopLeft);
            VerifySize(new SizeF(60, 80), result.TopRight);
            VerifySize(new SizeF(100, 120), result.BottomRight);
            VerifySize(new SizeF(140, 160), result.BottomLeft);
        }
Esempio n. 3
0
        public void ApplyTo_ScaleToNearestEvenDim_Test2()
        {
            var target = new WindowOutline
            {
                Size     = new SizeF(902.917969f, 902.917969f),
                TopLeft  = new SizeF(451.458954f, 902.917969f),
                TopRight = new SizeF(451.459f, 902.917969f)
            };

            var topObject = new MyTopObject();

            target.ApplyTo(topObject);

            VerifySize(new SizeF(902, 902), topObject.Dimensions.Size);
            var slant = new SizeF(451, 902);

            VerifySize(slant, topObject.get_Slants(0));
            VerifySize(slant, topObject.get_Slants(1));
            VerifySize(SizeF.Empty, topObject.get_Slants(2));
            VerifySize(SizeF.Empty, topObject.get_Slants(3));
        }
Esempio n. 4
0
        public void ApplyTo_ScaleToNearestEvenDim_Test()
        {
            var target = new WindowOutline
            {
                Size        = new SizeF(799.181641f, 799.1816f),
                TopLeft     = new SizeF(399.59082f, 399.59082f),
                TopRight    = new SizeF(399.59082f, 399.590851f),
                BottomRight = new SizeF(399.590851f, 399.590729f),
                BottomLeft  = new SizeF(399.59082f, 399.590759f)
            };

            var topObject = new MyTopObject();

            target.ApplyTo(topObject);

            VerifySize(new SizeF(800, 800), topObject.Dimensions.Size);
            var slant = new SizeF(400, 400);

            for (int i = 0; i < 4; i++)
            {
                VerifySize(slant, topObject.get_Slants(i));
            }
        }