1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using ICSharpCode.Scripting;
8
namespace ICSharpCode.Scripting.Tests.Console
11
public class OneItemCommandLineHistoryTestFixture
13
CommandLineHistory history;
18
history = new CommandLineHistory();
25
Assert.AreEqual(null, history.Current);
29
public void MovePrevious()
31
Assert.IsTrue(history.MovePrevious());
35
public void MovePreviousTwice()
37
history.MovePrevious();
38
Assert.IsFalse(history.MovePrevious());
42
public void MoveNextFails()
44
Assert.IsFalse(history.MoveNext());
48
public void CurrentAfterMovePrevious()
50
history.MovePrevious();
51
Assert.AreEqual("a", history.Current);
55
public void CurrentAfterMovePreviousTwice()
57
history.MovePrevious();
58
history.MovePrevious();
59
Assert.AreEqual("a", history.Current);
63
public void MovePreviousThenBack()
65
history.MovePrevious();
66
Assert.IsFalse(history.MoveNext());
70
public void CurrentAfterMovePreviousThenBack()
72
history.MovePrevious();
74
Assert.AreEqual("a", history.Current);
78
public void CurrentAfterMovePreviousTwiceThenBack()
80
history.MovePrevious();
81
history.MovePrevious();
83
Assert.AreEqual("a", history.Current);
87
public void MoveNextTwiceThenBack()
91
Assert.IsTrue(history.MovePrevious());
95
public void CurrentAfterMoveNextTwiceThenBack()
97
MoveNextTwiceThenBack();
98
Assert.AreEqual("a", history.Current);
102
public void IgnoreSameCommandLineEntered()
105
history.MovePrevious();
106
Assert.IsFalse(history.MovePrevious());