예제 #1
0
        public void TestAddingValidData()//checking if elements are added to the list successfully
        {
            ConsoleOutput consoleOutput = new ConsoleOutput();

            LinkedListHelpers.Node node = new LinkedListHelpers.Node('E');
            node.addNode('B');//data from the question
            node.addNode('E');
            node.addNode('E');
            node.addNode('B');
            node.addNode('A');
            node.addNode('B');
            node.print();
            //target.WriteToConsole(text);
            Assert.AreEqual("|E||->|B||->|E||->|E||->|B||->|A||->|B||->", consoleOutput.GetOuput().Trim());
        }
예제 #2
0
        public void TestAddingValidDeletingMoreThanThreeData1()//checking if elements are deleted from the list successfully
        {
            ConsoleOutput consoleOutput = new ConsoleOutput();

            LinkedListHelpers.Node node = new LinkedListHelpers.Node('A');
            node.addNode('A');
            node.addNode('E');
            node.addNode('E');
            node.addNode('B');
            node.addNode('A');
            node.addNode('B');
            node.addNode('E');
            node.addNode('B');
            node.addNode('F');
            node.deleteAllMMoreThanTwoSame('A');
            node.print();
            //target.WriteToConsole(text);
            Assert.AreEqual("|A||->|A||->|E||->|E||->|B||->|B||->|F||->", consoleOutput.GetOuput().Trim());
        }