Exemple #1
0
        public void TestEmptyList()
        {
            var expected   = new List <int> {
            };
            var solver     = new ListReorderer();
            var linkedList = GenerateLinkedListFromValues(new List <int> {
            });

            solver.ReorderList(linkedList);
            var actual = ConvertToList(linkedList);

            Assert.AreEqual(actual, expected);
        }
Exemple #2
0
        public void TestEvenNumberOfElements()
        {
            var expected = new List <int> {
                1, 4, 2, 3
            };
            var solver     = new ListReorderer();
            var linkedList = GenerateLinkedListFromValues(new List <int> {
                1, 2, 3, 4
            });

            solver.ReorderList(linkedList);
            var actual = ConvertToList(linkedList);

            Assert.AreEqual(actual, expected);
        }