Exemplo n.º 1
0
 public void DivisionBadTest()
 {
     IStack stack = new Stack();
     StackCalculator calculator = new StackCalculator(stack);
     calculator.Push(10);
     calculator.Push(0);
     calculator.Division();
 }
Exemplo n.º 2
0
 public void SimpleIncreaseTest()
 {
     IStack stack = new ArrayStack();
     StackCalculator calculator = new StackCalculator(stack);
     calculator.Push(10);
     calculator.Push(2);
     calculator.Increase();
     Assert.AreEqual(20, calculator.Result());
 }
Exemplo n.º 3
0
 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());
 }
Exemplo n.º 4
0
 public void SimpleDeductTest()
 {
     IStack stack = new ArrayStack();
     StackCalculator calculator = new StackCalculator(stack);
     calculator.Push(10);
     calculator.Push(2);
     calculator.Deduct();
     Assert.AreEqual(8, calculator.Result());
 }
Exemplo n.º 5
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());
 }
Exemplo n.º 6
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());
 }