示例#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");
 }
 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());
 }
 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());
 }
 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);
 }