public void TestPreviousAndNextShouldntUpdateHistory() { var selectionHistory = new SelectionHistory(); var selection1 = new GameObject(); var selection2 = new GameObject(); selectionHistory.UpdateSelection(selection1); selectionHistory.UpdateSelection(selection2); Assert.AreSame(selectionHistory.GetSelection(), selection2); Assert.AreEqual(selectionHistory.GetHistoryCount(), 2); selectionHistory.Previous(); selectionHistory.UpdateSelection(selection1); Assert.AreSame(selectionHistory.GetSelection(), selection1); Assert.AreEqual(selectionHistory.GetHistoryCount(), 2); selectionHistory.Next(); selectionHistory.UpdateSelection(selection2); Assert.AreSame(selectionHistory.GetSelection(), selection2); Assert.AreEqual(selectionHistory.GetHistoryCount(), 2); }
public void NextAndPreviousShouldntExplodeWithoutItems() { var selectionHistory = new SelectionHistory(); selectionHistory.Previous(); selectionHistory.Next(); Assert.Pass(); }
public static void PreviousSelection() { selectionHistory.Previous(); Selection.activeObject = selectionHistory.GetSelection(); }