Пример #1
0
		/// <summary>
		/// Two changes have been made, first on firstStack, then on secondStack. Verify that they must be Undone
		/// in the reverse order, and redone in the same order.
		/// </summary>
		/// <param name="firstStack"></param>
		/// <param name="secondStack"></param>
		private void VerifyOrderRequired(IActionHandler firstStack, IActionHandler secondStack)
		{
			Assert.That(firstStack.CanUndo(), Is.False); // can't undo the first change before the other.
			Assert.That(secondStack.CanUndo(), Is.True);
			secondStack.Undo(); // get back to where we can Undo creating it.
			Assert.That(firstStack.CanUndo(), Is.True); // now the second one is undone, we can
			firstStack.Undo(); // now both are undone.
			Assert.That(secondStack.CanRedo(), Is.False); // can't redo the second change first
			Assert.That(firstStack.CanRedo(), Is.True); // but of course we can redo the first one first
			firstStack.Redo();
			Assert.That(secondStack.CanRedo(), Is.True); // now we can redo the second change, since we already redid the first.

		}