public void Move_West_Initial() { BinaryTrack sut = BinaryTrack.StartEmptyTrack(_gameProps); var output = sut.MoveWest(); Assert.AreEqual((0, 0), output.Head); var map = output.ToCartesian(); MapAssert.AllCoordinatesAreZeroExcept(map, (0, 0), (1, 0)); }
public void Move_West_ShiftNeeded() { var shape = new[] { ".xx............", "Xxx............", "...............", "...............", }; BinaryTrack sut = BinaryTrack.FromString(_gameProps, shape); var output = sut.MoveWest(); Assert.AreEqual((0, 1), output.Head); var map = output.ToCartesian(); MapAssert.AllCoordinatesAreZeroExcept(map, (2, 0), (3, 0), (0, 1), (1, 1), (2, 1), (3, 1)); }
public void Move_West_NoShiftNeeded_CanMove() { var shape = new[] { "...............", "...............", "x.X............", "xxx............", }; BinaryTrack sut = BinaryTrack.FromString(_gameProps, shape); var output = sut.MoveWest(); Assert.AreEqual((1, 2), output.Head); var map = output.ToCartesian(); MapAssert.AllCoordinatesAreZeroExcept(map, (0, 2), (0, 3), (1, 2), (1, 3), (2, 2), (2, 3)); }