示例#1
0
 //[TestCase(20, 20, 10)]
 public void GetShortestPathCanWorkOnLargeGrid(int columns, int rows, int percentage)
 {
     var origin = BotTheCleanerLarge.Point.From(0, 0);
     var board  = GenerateBigGrid(columns, rows, percentage);
     var thrash = BotTheCleanerLarge.ExtractThrashCoords(board, 10).ToArray();
     var res    = BotTheCleanerLarge.GetShortestPath(origin, thrash);
     //var r = Visualise(res.Item1, columns, rows);
 }
示例#2
0
        public void GetShortestPath2()
        {
            var origin = BotTheCleanerLarge.Point.From(0, 0);
            var points = new[] { BotTheCleanerLarge.Point.From(1, 1) };

            var res = BotTheCleanerLarge.GetShortestPath(origin, points);

            Assert.That(res.Item2, Is.EqualTo(2));
        }
示例#3
0
        public void GetShortestPath3()
        {
            var origin = BotTheCleanerLarge.Point.From(0, 0);
            var points = new[]
            {
                BotTheCleanerLarge.Point.From(1, 1),
                BotTheCleanerLarge.Point.From(2, 2)
            };

            var res = BotTheCleanerLarge.GetShortestPath(origin, points);

            Assert.That(res.Item2, Is.EqualTo(4));
            Assert.That(res.Item1.Skip(1), Is.EqualTo(new[]
            {
                //BotTheCleanerLarge.Point.From(0, 0),
                BotTheCleanerLarge.Point.From(1, 1),
                BotTheCleanerLarge.Point.From(2, 2),
            }));
        }