Exemplo n.º 1
0
        public void PlateauWidthOrLengthIsNegativeShouldThrowException()
        {
            var instructionSet = new InstructionSet();
            instructionSet.Add("5 -1");

            instructionSet.GetPlateau();
        }
Exemplo n.º 2
0
        public void PlateauSizeMissWidthOrLengthShouldThrowException()
        {
            var instructionSet = new InstructionSet();
            instructionSet.Add("55");

            instructionSet.GetPlateau();
        }
Exemplo n.º 3
0
        public void InvalidPlateauWestToEastLengthShouldThrowException()
        {
            var instructionSet = new InstructionSet();
            instructionSet.Add("A 55");

            instructionSet.GetPlateau();
        }
Exemplo n.º 4
0
        public void InvalidPlateauSouthToNorthLengthShouldThrowException()
        {
            var instructionSet = new InstructionSet();
            instructionSet.Add("55 A");

            instructionSet.GetPlateau();
        }
Exemplo n.º 5
0
        public void CorrectPlateauSizeTest()
        {
            var instructionSet = new InstructionSet();
            instructionSet.Add("5 3");

            Plateau plateau = instructionSet.GetPlateau();

            Assert.AreEqual(5, plateau.WestToEastLength);
            Assert.AreEqual(3, plateau.SouthToNorthLength);
        }
Exemplo n.º 6
0
        public static RobotCollection LandingRobots(InstructionSet instructionSet)
        {
            var robotCollection = new RobotCollection();

            Plateau plateau = instructionSet.GetPlateau();

            foreach (IInstruction instruction in instructionSet)
            {
                var robot = new Robot(robotCollection.Count
                                      , instruction.GetLandingPosition()
                                      , instruction.GetLandingHeading()
                                      , instruction.GetMovingSequence()
                                      , plateau);

                robotCollection.Add(robot);
            }

            return robotCollection;
        }
Exemplo n.º 7
0
 public void NoPlateauInfoShouldThrowException()
 {
     var instructionSet = new InstructionSet();
     instructionSet.GetPlateau();
 }