コード例 #1
0
        //this method test Clear() method
        public void PushStart12345_0returned()
        {
            int expected = 0;

            simple_ds.Structures.LinkedList <int> list = new simple_ds.Structures.LinkedList <int>();

            for (var number = 1; number <= 5; ++number)
            {
                list.PushStart(number);
            }

            list.Clear();

            Assert.AreEqual(expected, list.Size());
        }
コード例 #2
0
        //this method test isEmpty() method
        public void PushStart12345_falsereturned()
        {
            bool expected = false;
            bool list_buffer;

            simple_ds.Structures.LinkedList <int> list = new simple_ds.Structures.LinkedList <int>();

            for (var number = 1; number <= 5; ++number)
            {
                list.PushStart(number);
            }

            list_buffer = list.isEmpty();

            Assert.AreEqual(expected, list_buffer);
        }
コード例 #3
0
        //this method test PushStart() method
        public void PushStart12345_1returned()
        {
            int expected      = 5;
            int expected_size = 5;
            int list_buffer;

            simple_ds.Structures.LinkedList <int> list = new simple_ds.Structures.LinkedList <int>();

            for (var number = 1; number <= 5; ++number)
            {
                list.PushStart(number);
            }

            list_buffer = list.PeekHead();

            Assert.AreEqual(expected, list_buffer);
            Assert.AreEqual(expected_size, list.Size());
        }