Пример #1
0
 public void ArrayClearTest()
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(10);
     stack.Clear();
     Assert.IsTrue(stack.Size() == 0);
 }
Пример #2
0
 public void ArrayPopTest()
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(10);
     stack.Push(9);
     stack.Pop();
     Assert.IsTrue(stack.Top() == 10);
 }
Пример #3
0
 public void ArrayPushTest()
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(1);
     stack.Push(2);
     stack.Push(3);
     Assert.IsTrue(stack.Top() == 3);
 }
Пример #4
0
 static void Main(string[] args)
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(10);
     stack.Push(0);
     stack.Push(100);
     Console.WriteLine(" Enter");
 }
Пример #5
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());
 }
Пример #6
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());
 }
Пример #7
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());
 }
Пример #8
0
 public void ArrayWriteTest()
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(10);
     stack.Push(0);
     stack.Push(100);
     string test = "100 0 10 ";
     Assert.AreEqual(stack.Write(), test);
 }
Пример #9
0
 public void ArrayWriteTest()
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(10);
     stack.Push(0);
     stack.Push(100);
     string test = "100 0 10 ";
     Assert.IsTrue(stack.Write() == test);
 }
Пример #10
0
 public void ArraySizeTest()
 {
     ArrayStack stack = new ArrayStack();
     Assert.AreEqual(0, stack.Size());
 }
Пример #11
0
 public void ArrayPushTest()
 {
     ArrayStack stack = new ArrayStack();
     stack.Push(1);
     Assert.IsTrue(stack.Size() == 1);
 }