Beispiel #1
0
        public void IsPointOnLine_StartingEdge_Horizontal_Test()
        {
            GameLogicSvc target = new GameLogicSvc();

            Wall w = new Wall() { Start = new Point() { X = 0, Y = 25 }, End = new Point() { X = 100, Y = 25 } };
            Point p = new Point() { X = 0, Y = 25 };

            bool isOnLine = target.isPointOnLine(p, w);

            Assert.AreEqual(true, isOnLine);
        }
Beispiel #2
0
        public void IsPointOnLine_StartingEdge_Vertical_Test()
        {
            GameLogicSvc target = new GameLogicSvc();

            Wall w = new Wall() { Start = new Point() { X = 50, Y = 0 }, End = new Point() { X = 50, Y = 50 } };
            Point p = new Point() { X = 50, Y = 0 };

            bool isOnLine = target.isPointOnLine(p, w);

            Assert.AreEqual(true, isOnLine);
        }
Beispiel #3
0
        public void IsPointOnLine_None_Vertical_Small_Test()
        {
            GameLogicSvc target = new GameLogicSvc();

            Wall w = new Wall() { Start = new Point() { X = 50, Y = 25 }, End = new Point() { X = 50, Y = 24 } };
            Point p = new Point() { X = 50, Y = 23 };

            bool isOnLine = target.isPointOnLine(p, w);

            Assert.AreEqual(false, isOnLine);
        }