Inheritance: Rectangle
Example #1
0
        public void TestSelection()
        {
            Point p1, p2, p3;
            List<Point> l;
            Selection s;

            p1 = new Point (2, 2);
            p2 = new Point (3, 5);
            p3 = new Point (6, 8);
            l = new List<Point> ();
            l.Add (p1);
            l.Add (p2);
            l.Add (p3);

            MultiPoints m = new MultiPoints (l);
            s = m.GetSelection (new Point (3, 5), 1);
            Assert.AreEqual (SelectionPosition.All, s.Position);

            s = m.GetSelection (new Point (0, 5), 1);
            Assert.IsNull (s);
            s = m.GetSelection (new Point (5, 12), 1);
            Assert.IsNull (s);
        }
Example #2
0
        public void TestAxis()
        {
            double xmin, xmax, ymin, ymax;
            Point p1, p2, p3;
            List<Point> l;

            p1 = new Point (2, 2);
            p2 = new Point (3, 5);
            p3 = new Point (6, 8);
            l = new List<Point> ();
            l.Add (p1);
            l.Add (p2);
            l.Add (p3);
            xmin = 2;
            xmax = 6;
            ymin = 2;
            ymax = 8;

            MultiPoints m = new MultiPoints (l);
            Assert.AreEqual (new Point (xmin, ymin), m.TopLeft);
            Assert.AreEqual (new Point (xmax, ymin), m.TopRight);
            Assert.AreEqual (new Point (xmax, ymax), m.BottomRight);
            Assert.AreEqual (new Point (xmin, ymax), m.BottomLeft);
        }
Example #3
0
        public void TestSerialization()
        {
            Point p1, p2, p3;
            List<Point> l;

            p1 = new Point (2, 2);
            p2 = new Point (3, 5);
            p3 = new Point (6, 8);
            l = new List<Point> ();
            l.Add (p1);
            l.Add (p2);
            l.Add (p3);

            MultiPoints m = new MultiPoints (l);
            Utils.CheckSerialization (m);
            MultiPoints nm = Utils.SerializeDeserialize(m);
            Assert.AreEqual (p1, nm.Points[0]);
            Assert.AreEqual (p2, nm.Points[1]);
            Assert.AreEqual (p3, nm.Points[2]);
        }