private static IEnumerable<Map> LoadLevels() { yield return Map.FromText(Resources.Dungeon1); yield return Map.FromText(Resources.Dungeon2); yield return Map.FromText(Resources.Dungeon3); yield return Map.FromText(Resources.Dungeon4); yield return Map.FromText(Resources.BigTestDungeon); }
public void ReturnShortestPath3() { var map = Map.FromText(Properties.Resources.BigTestDungeon); var expectedLength = 211; var path = DungeonTask.FindShortestPath(map); IsValidPath(map, path, expectedLength); }
private static IEnumerable <Map> LoadLevels() { yield return(Map.FromText(Properties.Resources.Dungeon1)); yield return(Map.FromText(Properties.Resources.Dungeon2)); yield return(Map.FromText(Properties.Resources.Dungeon3)); yield return(Map.FromText(Properties.Resources.Dungeon4)); }
public void Return_ShortestPaths_OnBigTestDangeon() { var map = Map.FromText(Properties.Resources.BigTestDungeon); var expectedLengths = new[] { 170, 156, 144, 137, 84 }; var paths = GetPaths(map) .OrderByDescending(x => x.Count) .ToArray(); AssertPaths(paths, map, expectedLengths); }
public void WorksCorrect_ShortestPaths_OnManyCalls() { var miniMap = Map.FromLines(new[] { " C ", "CPC", " C " }); var miniPaths = GetPaths(miniMap); AssertPaths(miniPaths, miniMap, new[] { 2, 2, 2, 2 }); var map = Map.FromText(Properties.Resources.BigTestDungeon); var paths = GetPaths(map) .OrderByDescending(x => x.Count) .ToArray(); AssertPaths(paths, map, new[] { 170, 156, 144, 137, 84 }); }