private void InitStack()
		{
			if (_tree == null)
			{
				return;
			}
			_stack = new Stack4();
			PushPreceding(_tree);
		}
Example #2
0
 private void InitStack()
 {
     if (_tree == null)
     {
         return;
     }
     _stack = new Stack4();
     PushPreceding(_tree);
 }
Example #3
0
		public virtual void TestPushPop()
		{
			Stack4 stack = new Stack4();
			AssertEmpty(stack);
			stack.Push("a");
			stack.Push("b");
			stack.Push("c");
			Assert.IsFalse(stack.IsEmpty());
			Assert.AreEqual("c", stack.Peek());
			Assert.AreEqual("c", stack.Peek());
			Assert.AreEqual("c", stack.Pop());
			Assert.AreEqual("b", stack.Pop());
			Assert.AreEqual("a", stack.Peek());
			Assert.AreEqual("a", stack.Pop());
			AssertEmpty(stack);
		}
Example #4
0
 public virtual void Reset()
 {
     _stack = null;
 }
		public virtual void Reset()
		{
			_stack = null;
		}
Example #6
0
			public _ICodeBlock_35(Stack4 stack)
			{
				this.stack = stack;
			}
Example #7
0
		private void AssertEmpty(Stack4 stack)
		{
			Assert.IsTrue(stack.IsEmpty());
			Assert.IsNull(stack.Peek());
			Assert.Expect(typeof(InvalidOperationException), new _ICodeBlock_35(stack));
		}