Exemple #1
0
        public void CountTestDefault()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello"; // TODO: Initialize to an appropriate value
            target.Push(item);
            target.Push(item);
            target.Push(item);

            int expected = 3; // TODO: Initialize to an appropriate value
            int actual;
            actual = target.Count();
            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void PushTestItemsInStack()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello";                                                // TODO: Initialize to an appropriate value

            target.Push(item);
            target.Push(item);

            string expected = "Hello"; // TODO: Initialize to an appropriate value
            string actual;

            actual = target.Pop();
            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void CountTestDefault()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello";                                                // TODO: Initialize to an appropriate value

            target.Push(item);
            target.Push(item);
            target.Push(item);

            int expected = 3; // TODO: Initialize to an appropriate value
            int actual;

            actual = target.Count();
            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void PushTestPushCastsStack()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            int item = 987654321;                                                 // TODO: Initialize to an appropriate value

            target.Push(item.ToString());
            target.Push(item.ToString());
            target.Push(item.ToString());
            target.Push(item.ToString());
            target.Push(item.ToString());

            string expected = "987654321"; // TODO: Initialize to an appropriate value
            string actual;

            actual = target.Pop();
            Assert.AreEqual(expected, actual);
        }
Exemple #5
0
        public void PopTestEmptyStackThenPush()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = target.Pop();                                           // TODO: Initialize to an appropriate value

            item = "Hello";                                                       // TODO: Initialize to an appropriate value
            target.Push(item);
            string actual;

            actual = target.Peek();
        }
Exemple #6
0
        public void IsEmptyTestAfterFillingStackThenPoppingStack()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello";                                                // TODO: Initialize to an appropriate value

            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            item = target.Pop();
            item = target.Pop();
            item = target.Pop();
            item = target.Pop();
            item = target.Pop();

            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;

            actual = target.IsEmpty();
            Assert.AreEqual(expected, actual);
        }
Exemple #7
0
        public void IsEmptyTestStackHasItem()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello";                                                // TODO: Initialize to an appropriate value

            target.Push(item);

            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;

            actual = target.IsEmpty();
            Assert.AreEqual(expected, actual);
        }
Exemple #8
0
        public void PeekTestCheckDoesntRemoveItem()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello";                                                // TODO: Initialize to an appropriate value

            target.Push(item);
            item = target.Peek();

            int expected = 1; // TODO: Initialize to an appropriate value
            int actual;

            actual = target.Count();
            Assert.AreEqual(expected, actual);
        }
Exemple #9
0
        public void PushTestFillStackWithStringArray()
        {
            string[] ARRAY = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" };
            Stack_Accessor <string> target = new Stack_Accessor <string>(ARRAY.Length); // TODO: Initialize to an appropriate value

            for (int i = 0; i < ARRAY.Length; i++)
            {
                target.Push(ARRAY[i]);
            }

            string expected = "Friday"; // TODO: Initialize to an appropriate value
            string actual;

            actual = target.Pop();
            Assert.AreEqual(expected, actual);
        }
Exemple #10
0
        public void PushTestPushStackIsFullException()
        {
            int param0 = 5;                                                       // TODO: Initialize to an appropriate value
            Stack_Accessor <string> target = new Stack_Accessor <string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello";                                                // TODO: Initialize to an appropriate value

            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
        }
Exemple #11
0
        public void PeekTestHelperDefault()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello"; // TODO: Initialize to an appropriate value
            target.Push(item);

            string expected = "Hello"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.Peek();
            Assert.AreEqual(expected, actual);
        }
Exemple #12
0
        public void PeekTestCheckDoesntRemoveItem()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello"; // TODO: Initialize to an appropriate value
            target.Push(item);
            item = target.Peek();

            int expected = 1; // TODO: Initialize to an appropriate value
            int actual;
            actual = target.Count();
            Assert.AreEqual(expected, actual);
        }
Exemple #13
0
 public void PushTestPushStackIsFullException()
 {
     int param0 = 5; // TODO: Initialize to an appropriate value
     Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
     string item = "Hello"; // TODO: Initialize to an appropriate value
     target.Push(item);
     target.Push(item);
     target.Push(item);
     target.Push(item);
     target.Push(item);
     target.Push(item);
 }
Exemple #14
0
        public void PushTestPushNullFullStack()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            string item = null; // TODO: Initialize to an appropriate value
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);

            string expected = null; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.Pop();
            Assert.AreEqual(expected, actual);
        }
Exemple #15
0
        public void PushTestPushCastsStack()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            int item = 987654321; // TODO: Initialize to an appropriate value
            target.Push(item.ToString());
            target.Push(item.ToString());
            target.Push(item.ToString());
            target.Push(item.ToString());
            target.Push(item.ToString());

            string expected = "987654321"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.Pop();
            Assert.AreEqual(expected, actual);
        }
Exemple #16
0
        public void PushTestFillStackWithStringArray()
        {
            string[] ARRAY = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" };
            Stack_Accessor<string> target = new Stack_Accessor<string>(ARRAY.Length); // TODO: Initialize to an appropriate value

            for (int i = 0; i < ARRAY.Length; i++)
            {
                target.Push(ARRAY[i]);
            }

            string expected = "Friday"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.Pop();
            Assert.AreEqual(expected, actual);
        }
Exemple #17
0
 public void PopTestEmptyStackThenPush()
 {
     int param0 = 5; // TODO: Initialize to an appropriate value
     Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
     string item = target.Pop(); // TODO: Initialize to an appropriate value
     item = "Hello"; // TODO: Initialize to an appropriate value
     target.Push(item);
     string actual;
     actual = target.Peek();
 }
Exemple #18
0
        public void IsEmptyTestAfterFillingStackThenPoppingStack()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello"; // TODO: Initialize to an appropriate value
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            target.Push(item);
            item = target.Pop();
            item = target.Pop();
            item = target.Pop();
            item = target.Pop();
            item = target.Pop();

            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.IsEmpty();
            Assert.AreEqual(expected, actual);
        }
Exemple #19
0
        public void IsEmptyTestStackHasItem()
        {
            int param0 = 5; // TODO: Initialize to an appropriate value
            Stack_Accessor<string> target = new Stack_Accessor<string>(param0); // TODO: Initialize to an appropriate value
            string item = "Hello"; // TODO: Initialize to an appropriate value
            target.Push(item);

            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.IsEmpty();
            Assert.AreEqual(expected, actual);
        }