Exemple #1
0
        public void ToString_StackTostring1item_string()
        {
            Stack testStack = new Stack();

            string testString = "this is a testString 1";

            testStack.push(testString);

            string toStringString = testStack.ToString();

            string expectedString = "0 this is a testString 1, ";

            Assert.AreEqual(toStringString, expectedString);
        }
Exemple #2
0
        public void ToString_StackTostring3item_string()
        {
            Stack testStack = new Stack();

            string testString = "this is a testString 1";
            string testString2 = "this is the 2nd test String";
            string testString3 = "this is the 3rd test String";

            testStack.push(testString);
            testStack.push(testString2);
            testStack.push(testString3);

            string toStringString = testStack.ToString();

            string expectedString = "0 this is a testString 1, 1 this is the 2nd test String, 2 this is the 3rd test String, ";

            Assert.AreEqual(expectedString, toStringString);
        }
Exemple #3
0
        public void ToString_StackTostring0item_string()
        {
            Stack testStack = new Stack();

            string toStringString = testStack.ToString();

            string expectedString = "Stack is empty.";

            Assert.AreEqual(expectedString, toStringString);
        }