public void TestEmptyHistoryNavigation() { var commandHistory = new CommandHistory(); string command = commandHistory.GetPreviousCommand(); Assert.IsEmpty(command); command = commandHistory.GetNextCommand(); Assert.IsEmpty(command); }
public void TestGetNextCommand() { var commandHistory = new CommandHistory(); commandHistory.Add("A0001"); string command = commandHistory.GetNextCommand(); Assert.IsEmpty(command); command = commandHistory.GetPreviousCommand(); Assert.AreEqual("A0001", command); command = commandHistory.GetNextCommand(); Assert.IsEmpty(command); commandHistory.Add("A0002"); command = commandHistory.GetPreviousCommand(); Assert.AreEqual("A0002", command); command = commandHistory.GetPreviousCommand(); Assert.AreEqual("A0001", command); command = commandHistory.GetNextCommand(); Assert.AreEqual("A0002", command); command = commandHistory.GetNextCommand(); Assert.IsEmpty(command); }