Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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();
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
 }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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();
 }
Пример #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);
        }
Пример #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);
        }