public void Equals() { StringStack stack = new StringStack(); stack.Push("one"); stack.Push("two"); stack.Push("three"); Assert.IsTrue(_stack.Equals(stack)); Assert.IsFalse(_stack.EqualsReverse(stack)); stack.Push("one"); Assert.IsFalse(_stack.Equals(stack)); stack.Pop(); Assert.IsTrue(_stack.Equals(stack)); }
public void Constructor() { StringStack stack = new StringStack(567); stack.Push("foo"); stack.Push("bar"); Assert.AreEqual(2, stack.Count); CloneableType[] array = new CloneableType[4] { "a", "b", "c", "d" }; stack = new StringStack(array); Assert.AreEqual(4, stack.Count); Assert.IsFalse(stack.Equals(array)); Assert.IsTrue(stack.EqualsReverse(array)); }