Exemple #1
0
        public void Test_Not_Empty()
        {
            var stack = new Stack2();

            stack.Push(1);

            Assert.AreEqual(false, stack.Empty());
        }
Exemple #2
0
 /**
 * Outputs the stack as the sequence of elements separated
 * by '.'.
 * @return the stack as the sequence of elements separated by '.'
 */
 protected String PrintStack() {
     if (stack.Empty())
         return "";
     StringBuilder s = new StringBuilder();
     foreach (String part in stack)
         s.Append('.').Append(part);
     return s.ToString(1, s.Length - 1);
 }
Exemple #3
0
            /**
             * Outputs the stack as the sequence of elements separated
             * by '.'.
             * @return the stack as the sequence of elements separated by '.'
             */
            virtual protected String PrintStack()
            {
                if (stack.Empty())
                {
                    return("");
                }
                StringBuilder s = new StringBuilder();

                foreach (String part in stack)
                {
                    s.Append('.').Append(part);
                }
                return(s.ToString(1, s.Length - 1));
            }
Exemple #4
0
        public void Test_Empty()
        {
            var stack = new Stack2();

            Assert.AreEqual(true, stack.Empty());
        }