public void CanFindNearestThrash() { var p = BotTheCleaner.GetNearestThrash(grid, 5, BotTheCleaner.Point.From(0, 0)); Assert.That( p, Is.EqualTo(BotTheCleaner.Point.From(1, 1))); }
public void CanExtractThrashCoords() { Assert.That(BotTheCleaner.ExtractThrashCoords(grid, 5), Is.EquivalentTo(new[] { BotTheCleaner.Point.From(0, 4), BotTheCleaner.Point.From(1, 1), BotTheCleaner.Point.From(1, 4), BotTheCleaner.Point.From(2, 2), BotTheCleaner.Point.From(2, 3), BotTheCleaner.Point.From(3, 2), BotTheCleaner.Point.From(4, 4) })); }
public void BotEmitsCorrectAction(int x, int y, string expected) { Assert.That(BotTheCleaner.GetNextCommand(x, y, grid), Is.EqualTo(expected)); }
public void CanCalculatePosFromIndex(int n, int pos, int x, int y) { Assert.That(BotTheCleaner.IndexToCoords(n, pos), Is.EqualTo(BotTheCleaner.Point.From(x, y))); }
public void CanCalculateDistanceBetweenPoints(int x1, int y1, int x2, int y2, int expected) { Assert.That(BotTheCleaner.GetDist(BotTheCleaner.Point.From(x1, y1), BotTheCleaner.Point.From(x2, y2)), Is.EqualTo(expected)); }