示例#1
0
        public void Ctor(int x, int y)
        {
            var point = new RoixIntPoint(x, y);

            point.X.Is(x);
            point.Y.Is(y);
        }
示例#2
0
        public void Deconstruct()
        {
            var point = new RoixIntPoint(1, 2);

            var(x, y) = point;
            x.Is(point.X);
            y.Is(point.Y);
        }
示例#3
0
        public void FromRoix()
        {
            double       x = 1.1, y = 2.2;
            var          rp1  = new RoixPoint(x, y);
            RoixIntPoint rip1 = rp1.ToRoixInt();

            rip1.X.Is((int)Math.Round(rp1.X));
            rip1.Y.Is((int)Math.Round(rp1.Y));
        }
示例#4
0
        public void ToRoix()
        {
            int       x = 1, y = 2;
            var       rip1 = new RoixIntPoint(x, y);
            RoixPoint rp1  = (RoixPoint)rip1;

            rp1.X.Is(rip1.X);
            rp1.Y.Is(rip1.Y);
        }
示例#5
0
        public void Equal()
        {
            int x = 1, y = 2;
            var p1 = new RoixIntPoint(x, y);
            var p2 = new RoixIntPoint(x, y);

            p1.Equals(p2).IsTrue();
            (p1 == p2).IsTrue();
            (p1 != p2).IsFalse();

            var obj2 = (object)p2;

            p1.Equals(obj2).IsTrue();
        }
示例#6
0
        public void Ctor(int x, int y, int width, int height)
        {
            var point = new RoixIntPoint(x, y);
            var size  = new RoixIntSize(width, height);

            var rect1 = new RoixIntRect(point, size);

            rect1.Location.X.Is(point.X);
            rect1.Location.Y.Is(point.Y);
            rect1.Size.Width.Is(size.Width);
            rect1.Size.Height.Is(size.Height);

            var rect2 = new RoixIntRect(new RoixIntPoint(x, y), new RoixIntSize(width, height));

            rect2.Location.X.Is(point.X);
            rect2.Location.Y.Is(point.Y);
            rect2.Size.Width.Is(size.Width);
            rect2.Size.Height.Is(size.Height);
        }