Beispiel #1
0
        public void PlateauWidthOrLengthIsNegativeShouldThrowException()
        {
            var instructionSet = new InstructionSet();
            instructionSet.Add("5 -1");

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

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

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

            instructionSet.GetPlateau();
        }
Beispiel #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);
        }
Beispiel #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;
        }
Beispiel #7
0
 public void NoPlateauInfoShouldThrowException()
 {
     var instructionSet = new InstructionSet();
     instructionSet.GetPlateau();
 }