Ejemplo n.º 1
0
        public void TestLeft_5()
        {
            IActionable robot = new TableRobot(new FiveByFiveTableActionValidator());

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

            robot.Left();

            var newState = robot.ToString();

            Assert.AreEqual("X: 0,  Y: 0,  Facing: EAST", newState, "Left action sucessful - from south to east");
        }
Ejemplo n.º 2
0
        public void TestLeft_4()
        {
            IActionable robot = new TableRobot(new FiveByFiveTableActionValidator());

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

            robot.Left();

            var newState = robot.ToString();

            Assert.AreEqual("X: 0,  Y: 0,  Facing: SOUTH", newState, "Left action sucessful - from west to south");
        }
Ejemplo n.º 3
0
        public void TestLeft_1()
        {
            IActionable robot = new TableRobot(new FiveByFiveTableActionValidator());

            var originalState = robot.ToString();

            robot.Left();

            var newState = robot.ToString();

            Assert.AreEqual(originalState, newState, "Left action failed - No left rotate before robot gets placed onto the table");
        }
Ejemplo n.º 4
0
        public void TestLeft_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.EAST);

            robot.Left();

            var newState = robot.ToString();

            Assert.AreEqual("X: 0,  Y: 0,  Facing: NORTH", newState, "Left action sucessful - from east to north");
        }
Ejemplo n.º 5
0
        public void TestLeft_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.Left();

            var newState = robot.ToString();

            Assert.AreEqual(originalState, newState, "Left action failed when validation is not passed");
        }