コード例 #1
0
        public void Should_Change_Orientation_Counterclockwise_When_LeftInstruction_Moves()
        {
            ShipPosition    position    = new ShipPosition(5, 5, Orientation.West);
            LeftInstruction instruction = new LeftInstruction(topRight, bottomLeft);

            //test
            ShipPosition actual = instruction.Move(position);

            //assert
            Assert.AreEqual(Orientation.South, actual.Orientation, "orientation not correct");
            Assert.AreEqual(position.X, actual.X, "ship should not have moved x corordinate");
            Assert.AreEqual(position.Y, actual.Y, "ship should not have moved y corordinate");
            Assert.AreEqual(false, actual.Lost, "ship should not be lost");
        }