Ejemplo n.º 1
0
        public void TestRemoveMinMultipleTimes()
        {
            Cell           expectedMinCell = new Cell(new Vector3(9, 8, 0), new Vector3(10, 10, 0));
            List <Cell>    cellList        = new List <Cell>(testPath);
            MinHeap <Cell> cellHeap        = new MinHeap <Cell>(cellList);

            Debug.Log("Start heap: " + cellHeap.ToString());
            cellHeap.RemoveMin();
            Debug.Log("First RemoveMin: " + cellHeap.ToString());
            Cell minCell = cellHeap.RemoveMin();

            Debug.Log("Second RemoveMin: " + cellHeap.ToString());
            Assert.IsTrue(expectedMinCell.Equals(minCell));
        }
Ejemplo n.º 2
0
        public void TestRemoveMin()
        {
            Cell           expectedMinCell = new Cell(new Vector3(10, 10, 0), new Vector3(10, 10, 0));
            List <Cell>    cellList        = new List <Cell>(testPath);
            MinHeap <Cell> cellHeap        = new MinHeap <Cell>(cellList);
            Cell           minCell         = cellHeap.RemoveMin();

            Assert.IsTrue(minCell.Equals(expectedMinCell));
        }
Ejemplo n.º 3
0
        public void TestRemoveMinLeavesValidHeap()
        {
            List <Cell>    cellList = new List <Cell>(testPath);
            MinHeap <Cell> cellHeap = new MinHeap <Cell>(cellList);

            Debug.Log(cellHeap.ToString());
            cellHeap.RemoveMin();
            Debug.Log(cellHeap.ToString());
            Assert.IsTrue(ValidMinHeap(cellHeap));
        }
Ejemplo n.º 4
0
        public void TestRemoveMinOnEmpty()
        {
            MinHeap <Cell> newHeap = new MinHeap <Cell>();

            Assert.IsNull(newHeap.RemoveMin());
        }