示例#1
0
 public void TestPop()
 {
     Stack.Stacker s = new Stack.Stacker();
     s.Push("Object1");
     s.Pop();
     Assert.True(s.IsEmpty());
 }
示例#2
0
        public void TestPopEqualsTop()
        {
            Stack.Stacker s     = new Stack.Stacker();
            String        line1 = "Object1";

            s.Push(line1);
            AssertionException.Equals(s.Top(), line1);
        }
示例#3
0
        public void TestTop()
        {
            Stack.Stacker s     = new Stack.Stacker();
            String        line1 = "Object1";

            s.Push(line1);
            AssertionException.Equals(s.Top(), line1);
            Assert.False(s.IsEmpty());
        }
示例#4
0
        public void TestPopEqualsPushThreeTimes()
        {
            Stack.Stacker s     = new Stack.Stacker();
            String        line1 = "Object1";
            String        line2 = "Object2";
            String        line3 = "Object3";

            s.Push(line1);
            s.Push(line1);
            s.Push(line1);
            AssertionException.Equals(s.Pop(), line3);
            AssertionException.Equals(s.Pop(), line2);
            AssertionException.Equals(s.Pop(), line1);
        }
示例#5
0
 public void TestTopOfEmptyStack()
 {
     Stack.Stacker s = new Stack.Stacker();
     Assert.Null(s.Top());
 }
示例#6
0
 public void TestIsEmpty()
 {
     Stack.Stacker s = new Stack.Stacker();
     Assert.True(s.IsEmpty());
 }
示例#7
0
 public void TestPushNullEqualsTop()
 {
     Stack.Stacker s = new Stack.Stacker();
     s.Push(null);
     AssertionException.Equals(s.Top(), null);
 }
示例#8
0
 public void TestPushNull()
 {
     Stack.Stacker s = new Stack.Stacker();
     s.Push(null);
     Assert.False(s.IsEmpty());
 }