protected void AssertTrainMovement(float startAngle, int startColumn, int startRow, int endColumn, int endRow) { GameBoard.AddTrain(startColumn, startRow); IMovable?train = GameBoard.GetMovables().First(); train.SetAngle(startAngle); Timer.Tick(); Timer.Tick(); Timer.Tick(); Assert.Equal(endColumn, train.Column); Assert.Equal(endRow, train.Row); }
protected void AssertTrainMovement(float startAngle, int startColumn, int startRow, int endColumn, int endRow) { var train = GameBoard.AddTrain(startColumn, startRow) as Train; train !.LookaheadDistance = 0.1f; train.SetAngle(startAngle); _output.WriteLine("Initial: " + train); for (int i = 0; i < 100; i++) { Timer.Tick(); _output.WriteLine($"Tick {i}: {train}"); } Assert.Equal((endColumn, endRow), (train.Column, train.Row)); }