public void RobotControllerTestM() { mockRobotInstructions = new MockRobotInstructions(repository); mockRobotInstructions.getRobotInstructions("r1"); Assert.NotNull(mockRobotInstructions); }
public void robotGetInstructions() { mockRobotInstructions = new MockRobotInstructions(repository); // Shoul be Empty. // Gave a non existing Key var result = mockRobotInstructions.getRobotInstructions("r0"); Assert.Null(result); }
public void robotGetInstructionS4() { mockRobotInstructions = new MockRobotInstructions(repository); // Shoul be Empty. var result = mockRobotInstructions.getRobotInstructions("r4"); var expected = "NMMLMMLMMMMM"; Assert.Equal(expected, result); }
public void PrintTest() { mockRobotInstructions = new MockRobotInstructions(repository); // Shoul be Empty. var moveInstructions = mockRobotInstructions.getRobotInstructions("r1"); var charArr = moveInstructions.ToCharArray(); var r1 = mockRobotInstructions.GetRobot("r1"); robotController = new RobotController(repository); ; }
public void RobotR4CheckFaults() { mockRobotInstructions = new MockRobotInstructions(repository); // Shoul be Empty. var moveInstructions = mockRobotInstructions.getRobotInstructions("r4"); var charArr = moveInstructions.ToCharArray(); var r4 = mockRobotInstructions.GetRobot("r4"); robotController = new RobotController(repository); var final = robotController.MoveRobot(r4, charArr); var result = final.Faults; Assert.NotEqual(3, result); }
public void robotInstruction(string key) { mockRobotInstructions = new MockRobotInstructions(_repository); //Get Instructions char[] charInstructList = mockRobotInstructions .getRobotInstructions(key) .ToCharArray(); // // Get Robot plus initial values. Console.WriteLine(charInstructList); var robotInitial = mockRobotInstructions.GetRobot(key); // Move Robot function. MoveRobot(robotInitial, charInstructList); }
public void RobotControllerCommands() { var _repository = new Mock <IRepository>(); var robotController = new RobotController( _repository.Object ); var data = new MockRobotInstructions(); var result = data.getRobotInstructions("r1"); _repository.Verify(r => r.getRobotInstructions("r2")); Assert.IsNotNull(result); }
public void moveRobotR4FinalPosition() { mockRobotInstructions = new MockRobotInstructions(repository); // Shoul be Empty. var robotInstructions = mockRobotInstructions.getRobotInstructions("r4"); var CharArr = robotInstructions.ToCharArray(); var r4 = mockRobotInstructions.GetRobot("r4"); robotController = new RobotController(repository); var result = robotController.MoveRobot(r4, CharArr); // FInal position expectation for r1 var expected = new Robot(new Location(0, 0, 'S')); expected.Faults = 3; Assert.NotEqual(expected, result); }
public void moveRobotR1() { mockRobotInstructions = new MockRobotInstructions(repository); // Shoul be Empty. var MoveInstructions = mockRobotInstructions.getRobotInstructions("r1"); var charrArr = MoveInstructions.ToCharArray(); var resultRobot = mockRobotInstructions.GetRobot("r1"); robotController = new RobotController(repository); var r1 = robotController.MoveRobot(resultRobot, charrArr); var expected = new Robot(new Location(0, 3, 'N')); expected.Faults = 0; Assert.Equal(expected, r1); }