示例#1
0
        public void Then_the_ship_moves_west()
        {
            const int distance  = 5;
            var       shipMover = new ShipMover();

            shipMover.InitialisePosition(new Point(0, 0));
            shipMover.MoveWest(distance);
            Assert.That(shipMover.GetPosition(), Is.EqualTo(new Point(-1 * distance, 0)));
        }
示例#2
0
        public void Then_the_ship_moves_forward()
        {
            //the ship starts facing east
            const int distance  = 5;
            var       shipMover = new ShipMover();

            shipMover.InitialisePosition(new Point(0, 0));
            shipMover.MoveForward(distance);
            Assert.That(shipMover.GetPosition(), Is.EqualTo(new Point(distance, 0)));
        }