Esempio 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));
        }
Esempio 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));
        }
Esempio 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));
        }
Esempio n. 4
0
        public void TestRemoveMinOnEmpty()
        {
            MinHeap <Cell> newHeap = new MinHeap <Cell>();

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