Exemplo n.º 1
0
        public void TestAddingValidData1()//checking if elements are added to 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.print();
            //target.WriteToConsole(text);
            Assert.AreEqual("|A||->|A||->|E||->|E||->|B||->|A||->|B||->|E||->|B||->|F||->", consoleOutput.GetOuput().Trim());
        }
Exemplo n.º 2
0
        public void TestAddingValidDeletingMoreThanThreeData()//checking if elements are deleted from 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.deleteAllMMoreThanTwoSame('E');
            node.print();
            //target.WriteToConsole(text);
            Assert.AreEqual("|E||->|B||->|E||->|B||->|A||->", consoleOutput.GetOuput().Trim());
        }