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)); }
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)); }
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)); }
public void TestRemoveMinOnEmpty() { MinHeap <Cell> newHeap = new MinHeap <Cell>(); Assert.IsNull(newHeap.RemoveMin()); }