Esempio n. 1
0
        public void LocateReverse()
        {
            LineD reverseDiagD = diagD.Reverse();

            Assert.AreEqual(LineLocation.End, reverseDiagD.Locate(new PointD(0, 0)));
            Assert.AreEqual(LineLocation.Start, reverseDiagD.Locate(new PointD(2, 2)));
            Assert.AreEqual(LineLocation.After, reverseDiagD.Locate(new PointD(-1, -1)));
            Assert.AreEqual(LineLocation.Between, reverseDiagD.Locate(new PointD(1, 1)));
            Assert.AreEqual(LineLocation.Before, reverseDiagD.Locate(new PointD(3, 3)));
            Assert.AreEqual(LineLocation.Right, reverseDiagD.Locate(new PointF(0, 1)));
            Assert.AreEqual(LineLocation.Left, reverseDiagD.Locate(new PointF(1, 0)));

            LineF reverseDiagF = diagF.Reverse();

            Assert.AreEqual(LineLocation.End, reverseDiagF.Locate(new PointF(0, 0)));
            Assert.AreEqual(LineLocation.Start, reverseDiagF.Locate(new PointF(2, 2)));
            Assert.AreEqual(LineLocation.After, reverseDiagF.Locate(new PointF(-1, -1)));
            Assert.AreEqual(LineLocation.Between, reverseDiagF.Locate(new PointF(1, 1)));
            Assert.AreEqual(LineLocation.Before, reverseDiagF.Locate(new PointF(3, 3)));
            Assert.AreEqual(LineLocation.Right, reverseDiagF.Locate(new PointI(0, 1)));
            Assert.AreEqual(LineLocation.Left, reverseDiagF.Locate(new PointI(1, 0)));

            LineI reverseDiagI = diagI.Reverse();

            Assert.AreEqual(LineLocation.End, reverseDiagI.Locate(new PointI(0, 0)));
            Assert.AreEqual(LineLocation.Start, reverseDiagI.Locate(new PointI(2, 2)));
            Assert.AreEqual(LineLocation.After, reverseDiagI.Locate(new PointI(-1, -1)));
            Assert.AreEqual(LineLocation.Between, reverseDiagI.Locate(new PointI(1, 1)));
            Assert.AreEqual(LineLocation.Before, reverseDiagI.Locate(new PointI(3, 3)));
            Assert.AreEqual(LineLocation.Right, reverseDiagI.Locate(new PointI(0, 1)));
            Assert.AreEqual(LineLocation.Left, reverseDiagI.Locate(new PointI(1, 0)));
        }
Esempio n. 2
0
 public void Reverse()
 {
     Assert.AreEqual(new LineD(4, 5, 1, 3), lineD.Reverse());
     Assert.AreEqual(new LineF(4, 5, 1, 3), lineF.Reverse());
     Assert.AreEqual(new LineI(4, 5, 1, 3), lineI.Reverse());
 }