Esempio n. 1
0
        public void GetDistanceVector()
        {
            Assert.AreEqual(new PointD(-1, -2), rectD.GetDistanceVector(PointD.Empty));
            Assert.AreEqual(PointD.Empty, rectD.GetDistanceVector(rectD.TopLeft));
            Assert.AreEqual(PointD.Empty, rectD.GetDistanceVector(new PointD(3, 6)));
            Assert.AreEqual(PointD.Empty, rectD.GetDistanceVector(rectD.BottomRight));
            Assert.AreEqual(new PointD(+1, +2), rectD.GetDistanceVector(new PointD(6, 9)));

            Assert.AreEqual(new PointF(-1, -2), rectF.GetDistanceVector(PointF.Empty));
            Assert.AreEqual(PointF.Empty, rectF.GetDistanceVector(rectF.TopLeft));
            Assert.AreEqual(PointF.Empty, rectF.GetDistanceVector(new PointF(3, 6)));
            Assert.AreEqual(PointF.Empty, rectF.GetDistanceVector(rectF.BottomRight));
            Assert.AreEqual(new PointF(+1, +2), rectF.GetDistanceVector(new PointF(6, 9)));

            Assert.AreEqual(new PointI(-1, -2), rectI.GetDistanceVector(PointI.Empty));
            Assert.AreEqual(PointI.Empty, rectI.GetDistanceVector(rectI.TopLeft));
            Assert.AreEqual(PointI.Empty, rectI.GetDistanceVector(new PointI(3, 6)));
            Assert.AreEqual(PointI.Empty, rectI.GetDistanceVector(rectI.BottomRight));
            Assert.AreEqual(new PointI(+1, +2), rectI.GetDistanceVector(new PointI(6, 9)));
        }