Пример #1
0
 public void SimpleAddTest()
 {
     IStack stack = new ArrayStack();
     StackCalculator calculator = new StackCalculator(stack);
     calculator.Push(1);
     calculator.Push(2);
     calculator.Add();
     Assert.AreEqual(3, calculator.Result());
 }
Пример #2
0
 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());
 }