Ejemplo n.º 1
0
        public void CanFindNearestThrash()
        {
            var p = BotTheCleaner.GetNearestThrash(grid, 5, BotTheCleaner.Point.From(0, 0));

            Assert.That(
                p,
                Is.EqualTo(BotTheCleaner.Point.From(1, 1)));
        }
Ejemplo n.º 2
0
 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)
     }));
 }
Ejemplo n.º 3
0
 public void BotEmitsCorrectAction(int x, int y, string expected)
 {
     Assert.That(BotTheCleaner.GetNextCommand(x, y, grid), Is.EqualTo(expected));
 }
Ejemplo n.º 4
0
 public void CanCalculatePosFromIndex(int n, int pos, int x, int y)
 {
     Assert.That(BotTheCleaner.IndexToCoords(n, pos), Is.EqualTo(BotTheCleaner.Point.From(x, y)));
 }
Ejemplo n.º 5
0
 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));
 }