public void ClearTest() { Stack stack = new Stack(); stack.Push(10); stack.Clear(); Assert.IsTrue(stack.Size() == 0); }
public void DivisionBadTest() { IStack stack = new Stack(); StackCalculator calculator = new StackCalculator(stack); calculator.Push(10); calculator.Push(0); calculator.Division(); }
public void PopGoodTest() { Stack stack = new Stack(); stack.Push(10); stack.Push(9); stack.Pop(); Assert.IsTrue(stack.Top() == 10); }
public void SimpleDivisionTest() { IStack stack = new Stack(); StackCalculator calculator = new StackCalculator(stack); calculator.Push(10); calculator.Push(2); calculator.Division(); Assert.AreEqual(5, calculator.Result()); }
public void WriteTest() { Stack stack = new Stack(); stack.Push(10); stack.Push(0); stack.Push(100); string test = "100 0 10 "; Assert.IsTrue(stack.Write() == test); }
public void StrongTest() { IStack stack = new Stack(); StackCalculator calculator = new StackCalculator(stack); calculator.Push(7); calculator.Push(8); calculator.Add(); calculator.Push(13); calculator.Deduct(); calculator.Push(2); calculator.Division(); Assert.AreEqual(1, calculator.Result()); }
public ElementOfStack(Stack stack) { this.Next = stack.head; }
public void SizeTest() { Stack stack = new Stack(); Assert.IsTrue(stack.Size() == 0); }
public void PushTest() { Stack stack = new Stack(); stack.Push(1); Assert.IsTrue(stack.Size() == 1); }
public void PopBadTest() { Stack stack = new Stack(); stack.Pop(); }