Пример #1
0
 public IEnumerable<ICell> ProcessTest(
     [PexAssumeUnderTest]global::PathfindingAlgorithms.Algorithms.Astar.Astar target,
     ICell[,] cells,
     Coordinates from,
     Coordinates to
     )
 {
     PexAssume.IsNotNull(cells);
     PexAssume.IsTrue(cells.GetLength(0)* cells.GetLength(1) > 0);
     PexAssume.IsTrue(from.Inside(new Coordinates(cells.GetLength(0) - 1, cells.GetLength(1) - 1)));
     PexAssume.IsTrue(to.Inside(new Coordinates(cells.GetLength(0) - 1, cells.GetLength(1) - 1)));
     PexAssume.IsTrue(cells.GetLowerBound(0) == 0);
     PexAssume.IsTrue(cells.GetLowerBound(1) == 0);
     bool f = true;
     for (int x = cells.GetLowerBound(0); x <= cells.GetUpperBound(0); x++)
     {
         for (int y = cells.GetLowerBound(1); y <= cells.GetUpperBound(1); y++)
         {
             PexAssume.IsNotNull(cells[x, y]);
             PexAssume.IsNotNull(cells[x, y].Coordinates);
             f &= cells[x, y].Coordinates.Equals(new Coordinates(x, y));
         }
     }
     PexAssume.IsTrue(f);
     IEnumerable<ICell> result = target.Process(cells, from, to);
     return result;
     // TODO: добавление проверочных утверждений в метод AstarTest.ProcessTest(Astar, ICell[,], Coordinates, Coordinates)
 }