コード例 #1
0
        public void Move_Move_Rotate_Left_Move_Robot_After_Placing_On_Table_Report()
        {
            var robotInstructions = new RobotInstructions();

            var placeResult = robotInstructions.Place(1, 2, FacingDirection.East);

            Assert.AreEqual(placeResult, true);

            var moveResult1 = robotInstructions.Move();

            Assert.AreEqual(moveResult1, true);

            var moveResult2 = robotInstructions.Move();

            Assert.AreEqual(moveResult2, true);

            var rotateResult = robotInstructions.Left();

            Assert.AreEqual(rotateResult, true);

            var moveResult3 = robotInstructions.Move();

            Assert.AreEqual(moveResult3, true);

            var reportResult = robotInstructions.Report();

            Assert.AreEqual("3,3,NORTH", reportResult);
        }
コード例 #2
0
        public void Rotate_Robot_Before_Placing_On_Table()
        {
            var robotInstructions = new RobotInstructions();

            var moveResult = robotInstructions.Left();

            Assert.AreEqual(moveResult, false);
            Assert.AreEqual("Robot can not rotate Left!! Robot is not placed on the table.", RobotStatus._error);

            var moveResult2 = robotInstructions.Right();

            Assert.AreEqual(moveResult2, false);
            Assert.AreEqual("Robot can not rotate Right!! Robot is not placed on the table.", RobotStatus._error);
        }
コード例 #3
0
        public void Rotate_Robot_After_Placing_On_Table()
        {
            var robotInstructions = new RobotInstructions();

            var placeResult = robotInstructions.Place(0, 0, FacingDirection.North);

            Assert.AreEqual(placeResult, true);

            var moveResult = robotInstructions.Left();

            Assert.AreEqual(moveResult, true);

            var moveResult2 = robotInstructions.Right();

            Assert.AreEqual(moveResult2, true);
        }
コード例 #4
0
        public void Rotate_Left_Robot_After_Placing_On_Table_Report()
        {
            var robotInstructions = new RobotInstructions();

            var placeResult = robotInstructions.Place(0, 0, FacingDirection.North);

            Assert.AreEqual(placeResult, true);

            var rotateResult = robotInstructions.Left();

            Assert.AreEqual(rotateResult, true);

            var reportResult = robotInstructions.Report();

            Assert.AreEqual("0,0,WEST", reportResult);
        }