Beispiel #1
0
        public void TestRight_5()
        {
            IActionable robot = new TableRobot(new FiveByFiveTableActionValidator());

            robot.Place(0, 0, Facing.NORTH);

            robot.Right();

            var newState = robot.ToString();

            Assert.AreEqual("X: 0,  Y: 0,  Facing: EAST", newState, "Right action sucessful - from north to east");
        }
Beispiel #2
0
        public void TestRight_4()
        {
            IActionable robot = new TableRobot(new FiveByFiveTableActionValidator());

            robot.Place(0, 0, Facing.WEST);

            robot.Right();

            var newState = robot.ToString();

            Assert.AreEqual("X: 0,  Y: 0,  Facing: NORTH", newState, "Right action sucessful - from west to north");
        }
Beispiel #3
0
        public void TestRight_1()
        {
            IActionable robot = new TableRobot(new FiveByFiveTableActionValidator());

            var originalState = robot.ToString();

            robot.Right();

            var newState = robot.ToString();

            Assert.AreEqual(originalState, newState, "Right action failed - No right rotate before robot gets placed onto the table");
        }
Beispiel #4
0
        public void TestRight_1()
        {
            var mock = new Mock <IActionValidator>();

            mock.Setup(m => m.Validate(It.IsAny <int>(), It.IsAny <int>())).Returns(false);

            IActionable robot = new TableRobot(mock.Object);

            var originalState = robot.ToString();

            robot.Right();

            var newState = robot.ToString();

            Assert.AreEqual(originalState, newState, "Right action failed when validation is not passed");
        }
Beispiel #5
0
        public void TestRight_5()
        {
            var mock = new Mock <IActionValidator>();

            mock.Setup(m => m.Validate(It.IsAny <int>(), It.IsAny <int>())).Returns(true);

            IActionable robot = new TableRobot(mock.Object);


            robot.Place(0, 0, Facing.NORTH);

            robot.Right();

            var newState = robot.ToString();

            Assert.AreEqual("X: 0,  Y: 0,  Facing: EAST", newState, "Right action sucessful - from north to east");
        }