예제 #1
0
        public void SetPlanIdTest1()
        {
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 0, 0, Tuple.Create <short, short>(5, 5));

            tbot.PlanId = 3;
            Assert.AreEqual(tbot.PlanId, 3);
        }
예제 #2
0
        public void SetPlanSizeTest1()
        {
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 0, 0, Tuple.Create <short, short>(5, 5));

            tbot.PlanSize = Tuple.Create <short, short>(4, 4);
            Assert.AreEqual(tbot.PlanSize, Tuple.Create <short, short>(4, 4));
        }
예제 #3
0
        public void GetOrientationTest1()
        {
            // Testing modulo setting
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 4, 0, Tuple.Create <short, short>(5, 5));

            Assert.AreEqual(tbot.Orientation, 0);
        }
예제 #4
0
        public void SetOrientationTest1()
        {
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 4, 0, Tuple.Create <short, short>(5, 5));

            tbot.Orientation = 403;
            Assert.AreEqual(tbot.Orientation, 3);
        }
예제 #5
0
        public void RotateTest2()
        {
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 0, 0, Tuple.Create <short, short>(5, 5));

            tbot.Rotate(-1);
            Assert.AreEqual(tbot.Orientation, 3);
        }
예제 #6
0
        public void MoveTest1()
        {
            // Testing North Movement
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 0, 0, Tuple.Create <short, short>(5, 5));

            tbot.Move();
            Assert.AreEqual(tbot.Position, Tuple.Create <short, short>(0, 1));
        }
예제 #7
0
        public void MoveBoundaryTest4()
        {
            // Testing Southern Boundary Non-Movement
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 3, 0, Tuple.Create <short, short>(5, 5));

            tbot.Move();
            Assert.AreEqual(tbot.Position, Tuple.Create <short, short>(0, 0));
        }
예제 #8
0
        public void SetPositionTest1()
        {
            // it would be better to have something in the set function that sets the values to a minimum of 0 when entering
            // the plan size and position, or a simple if statement that checks that the values aren't negative.
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 0, 0, Tuple.Create <short, short>(5, 5));

            tbot.Position = Tuple.Create <short, short>(3, 1);
            Assert.AreEqual(tbot.Position, Tuple.Create <short, short>(3, 1));
        }
예제 #9
0
        public void FindOrientationTest4()
        {
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 3, 0, Tuple.Create <short, short>(5, 5));

            Assert.AreEqual(tbot.FindOrientation(tbot.Orientation), "West");
        }
예제 #10
0
        public void GetPositionTest1()
        {
            ToyBotObj tbot = new ToyBotObj(Tuple.Create <short, short>(0, 0), 0, 0, Tuple.Create <short, short>(5, 5));

            Assert.AreEqual(tbot.Position, Tuple.Create <short, short>(0, 0));
        }