public void Move_Robot_Before_Placing_On_Table()
        {
            var robotInstructions = new RobotInstructions();

            var moveResult = robotInstructions.Move();
            Assert.AreEqual(moveResult, false);
            Assert.AreEqual("Robot can not move!! Robot is not placed on the table.", robotInstructions._error);
        }
        public void Place_Robot_InsideTableBoundary()
        {
            var robotInstructions = new RobotInstructions();

            var result = robotInstructions.Place(0, 0, FacingDirection.North);
            Assert.AreEqual(result,true);

            var result2 = robotInstructions.Place(5, 5, FacingDirection.North);
            Assert.AreEqual(result2, true);
        }
        public void Report_After_Placing_On_Table()
        {
            var robotInstructions = new RobotInstructions();

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

            var reportResult = robotInstructions.Report();
            Assert.AreEqual("0,0,NORTH", reportResult);
        }
        public void Move_Robot_After_Placing_On_Table_But_Out_Of_Table_Boundary()
        {
            var robotInstructions = new RobotInstructions();

            var placeResult = robotInstructions.Place(0, 0, FacingDirection.South);
            Assert.AreEqual(placeResult, true);

            var moveResult = robotInstructions.Move();
            Assert.AreEqual("Can not Move the Robot out of the table boundary.", robotInstructions._error);
        }
        public void Move_Robot_After_Placing_On_Table()
        {
            var robotInstructions = new RobotInstructions();

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

            var moveResult = robotInstructions.Move();
            Assert.AreEqual(moveResult, true);
        }
        public void Place_Robot_OutsideTableBoundary()
        {
            var robotInstructions = new RobotInstructions();

            var result = robotInstructions.Place(0, -1, FacingDirection.North);
            Assert.AreEqual(result,false);
            Assert.AreEqual("Can not Place the Robot out of the table boundary.", RobotStatus._error);

            var result2 = robotInstructions.Place(6, 0, FacingDirection.North);
            Assert.AreEqual(result2, false);
            Assert.AreEqual("Can not Place the Robot out of the table boundary.", RobotStatus._error);
        }
        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);
        }
        public void Report_After_Placing_On_Table_After_Rotating()
        {
            var robotInstructions = new RobotInstructions();

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

            var leftRotateResult = robotInstructions.Left();
            Assert.AreEqual(leftRotateResult, true);

            var reportResult = robotInstructions.Report();
            Assert.AreEqual("0,0,WEST", reportResult);
        }
        public void Report_After_Placing_On_Table_After_Moving_And_Rotating()
        {
            var robotInstructions = new RobotInstructions();

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

            var moveResult = robotInstructions.Move();
            Assert.AreEqual(moveResult, true);

            var rightRotateResult = robotInstructions.Right();
            Assert.AreEqual(rightRotateResult, true);

            var reportResult = robotInstructions.Report();
            Assert.AreEqual("0,1,EAST", reportResult);
        }
        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);
        }
        public void Report_Before_Placing_On_Table()
        {
            var robotInstructions = new RobotInstructions();

            var reportResult = robotInstructions.Report();
            Assert.AreEqual("Can not generate the report!! Robot is not placed on the table.", reportResult);
        }
示例#12
0
 public RobotDriver(RobotInstructions robotInstructions)
 {
     this._robotInstructions = robotInstructions;
 }
示例#13
0
 public RobotDriver(RobotInstructions robotInstructions)
 {
     this._robotInstructions = robotInstructions;
 }