Beispiel #1
0
        static void Main(string[] args)
        {
            int intMaxx = 5;
            int intMaxy = 5;

            int    intXCord     = 1;
            int    intYCord     = 3;
            char   chDirection  = 'e';
            string strNavString = "MMRMMRMRRM";

            BionicAnt bionic = new BionicAnt(intMaxx, intMaxy);

            Console.WriteLine(bionic.NavigateToPlateu(intXCord, intYCord, chDirection, strNavString));

            Console.ReadKey();
        }
        public void BionicAntTestInvalidNavString()
        {
            //Arrange
            int    intMaxx           = 5;
            int    intMaxy           = 5;
            int    intXCord          = 7; //Input coordinates are bigger than max, so invalid input
            int    intYCord          = 3;
            char   chDirection       = 'E';
            string strNavString      = "12312312";
            string strExpectedoutput = "5 1 E";
            string strActualoutput   = "";

            //Act
            BionicAnt bionicAnt = new BionicAnt(intMaxx, intMaxy);

            strActualoutput = bionicAnt.NavigateToPlateu(intXCord, intYCord, chDirection, strNavString);

            //Assert
            Assert.AreNotEqual(strExpectedoutput, strActualoutput);
        }
        public void BionicAntTestInvalidOutput()
        {
            //Arrange
            int    intMaxx           = 5;
            int    intMaxy           = 5;
            int    intXCord          = 3;
            int    intYCord          = 3;
            char   chDirection       = 'E';
            string strNavString      = "MMRMMRMRRRRRRMMMMMMM";
            string strExpectedoutput = "5 1 E";
            string strActualoutput   = "";

            //Act
            BionicAnt bionicAnt = new BionicAnt(intMaxx, intMaxy);

            strActualoutput = bionicAnt.NavigateToPlateu(intXCord, intYCord, chDirection, strNavString);

            //Assert
            Assert.AreNotEqual(strExpectedoutput, strActualoutput);
        }