Esempio n. 1
0
        public void TurtleIgnoringOtherCommandsBeforePlacedOnTable()
        {
            var turtleCommand = new TurtleCommand(5, 5);

            turtleCommand.Left();
            Assert.AreEqual(turtleCommand.CurrentDirection, null);
            Assert.AreEqual(turtleCommand.XCoOrdinate, null);
            Assert.AreEqual(turtleCommand.YCoOrdinate, null);
        }
Esempio n. 2
0
        public void TestCase2()
        {
            var turtleCommand = new TurtleCommand(5, 5);

            turtleCommand.Place(0, 0, Direction.North);
            turtleCommand.Left();
            var report = turtleCommand.Report();

            Assert.AreEqual(report.Item1, 0);
            Assert.AreEqual(report.Item2, 0);
            Assert.AreEqual(report.Item3, Direction.West);
        }
Esempio n. 3
0
        public void TestCase3()
        {
            var turtleCommand = new TurtleCommand(5, 5);

            turtleCommand.Place(1, 2, Direction.East);
            turtleCommand.Move();
            turtleCommand.Move();
            turtleCommand.Left();
            turtleCommand.Move();

            var report = turtleCommand.Report();

            Assert.AreEqual(report.Item1, 3);
            Assert.AreEqual(report.Item2, 3);
            Assert.AreEqual(report.Item3, Direction.North);
        }