Exemplo n.º 1
1
        public void TestConstructor()
        {
            Rectangle s = new Rectangle (Color.Red, 50, 50, 100, 100);

            Assert.IsTrue (s.IsAt (SwinGame.PointAt (50, 50)));
            Assert.IsTrue (s.IsAt (SwinGame.PointAt (150, 50)));
            Assert.IsTrue (s.IsAt (SwinGame.PointAt (50, 150)));
            Assert.IsTrue (s.IsAt (SwinGame.PointAt (150, 150)));

            Assert.IsTrue (s.Color == Color.Red);
        }
Exemplo n.º 2
1
        public void TestShapeAtWhenMoved()
        {
            Rectangle s = new Rectangle ();

            s.X = 25;
            s.Y = 25;

            Assert.IsTrue (s.IsAt (SwinGame.PointAt (50, 50)));

            s.X = 100;
            s.Y = 100;

            Assert.IsFalse (s.IsAt (SwinGame.PointAt (50, 50)));
        }
Exemplo n.º 3
0
        public void TestCase()
        {
            Rectangle newRect = new Rectangle();

            newRect.X      = 25;
            newRect.Y      = 25;
            newRect.Width  = 50;
            newRect.Height = 50;

            Assert.IsTrue(newRect.IsAt(SwinGame.PointAt(50, 50)));
            Assert.IsFalse(newRect.IsAt(SwinGame.PointAt(76, 76)));
        }
        public void TestShapeAt()
        {
            Rectangle s = new Rectangle();

            s.X      = 25;
            s.Y      = 25;
            s.Width  = 50;
            s.Height = 50;

            Assert.IsTrue(s.IsAt(SwinGame.PointAt(50, 50)));
            Assert.IsTrue(s.IsAt(SwinGame.PointAt(25, 25)));
            Assert.IsFalse(s.IsAt(SwinGame.PointAt(10, 50)));
            Assert.IsFalse(s.IsAt(SwinGame.PointAt(50, 10)));
        }
Exemplo n.º 5
0
        public void TestShapeAt()
        {
            Rectangle s = new Rectangle ();

            s.X = 25;
            s.Y = 25;
            s.Width = 50;
            s.Height = 50;

            Assert.IsTrue (s.IsAt (SwinGame.PointAt (50, 50)));
            Assert.IsTrue (s.IsAt (SwinGame.PointAt (25, 25)));
            Assert.IsFalse (s.IsAt (SwinGame.PointAt (10, 50)));
            Assert.IsFalse (s.IsAt (SwinGame.PointAt (50, 10)));
        }
        public void TestShapeWhenResized()
        {
            Rectangle s = new Rectangle();

            s.X      = 0;
            s.Y      = 0;
            s.Width  = 50;
            s.Height = 50;

            Assert.IsTrue(s.IsAt(SwinGameSDK.SwinGame.PointAt(25, 25)));

            s.Width  = 5;
            s.Height = 5;

            Assert.IsFalse(s.IsAt(SwinGameSDK.SwinGame.PointAt(25, 25)));
        }
Exemplo n.º 7
0
        public void TestShapeAtWhenResized()
        {
            Rectangle s = new Rectangle ();

            s.X = 25;
            s.Y = 25;
            s.Width = 50;
            s.Height = 50;

            Assert.IsTrue (s.IsAt (SwinGame.PointAt (75, 75)));

            s.Width = 25;
            s.Height = 25;

            Assert.IsFalse (s.IsAt (SwinGame.PointAt (75, 75)));
        }
Exemplo n.º 8
0
        public void TestShapeAtWhenMoved()
        {
            Rectangle newRect = new Rectangle();

            newRect.X      = 30;
            newRect.Y      = 30;
            newRect.Width  = 50;
            newRect.Height = 50;

            Assert.IsTrue(newRect.IsAt(SwinGame.PointAt(50, 50)));
            Assert.IsFalse(newRect.IsAt(SwinGame.PointAt(25, 25)));

            newRect.X = 25;
            newRect.Y = 25;
            Assert.IsTrue(newRect.IsAt(SwinGame.PointAt(50, 50)));
            Assert.IsFalse(newRect.IsAt(SwinGame.PointAt(76, 76)));
        }
        public void TestShapeAtWhenResized()
        {
            Rectangle s = new Rectangle();

            s.X      = 25;
            s.Y      = 25;
            s.Width  = 50;
            s.Height = 50;

            Assert.IsTrue(s.IsAt(SwinGame.PointAt(75, 75)));
            Assert.IsFalse(s.IsAt(SwinGame.PointAt(50, 10)));

            s.Width  = 25;
            s.Height = 25;

            Assert.IsTrue(s.IsAt(SwinGame.PointAt(50, 50)));
            Assert.IsFalse(s.IsAt(SwinGame.PointAt(75, 75)));
        }