Exemplo n.º 1
0
 public void TestValidCharEnteredToDeleteAllMMoreThanTwoSame()//only A to Z is acceptable
 {
     try
     {
         LinkedListHelpers.Node node = new LinkedListHelpers.Node('Y');
         node.deleteAllMMoreThanTwoSame('Y');
     }
     catch (Exception ex)
     {
         Assert.Fail("No exception is expected since it is a valid char. " + ex);
     }
 }
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());
        }
Exemplo n.º 3
0
 public void TestInvalidCharEnteredToDeleteAllMMoreThanTwoSame1()//only A to Z is acceptable
 {
     LinkedListHelpers.Node node = new LinkedListHelpers.Node('A');
     node.deleteAllMMoreThanTwoSame('0');
 }
Exemplo n.º 4
0
 public void TestDeleteWithNEmptyChar()//empty input is not accepted
 {
     LinkedListHelpers.Node node = new LinkedListHelpers.Node('E');
     node.deleteAllMMoreThanTwoSame('\0');
 }
Exemplo n.º 5
0
 public void TestDeleteWithNull()//null input is not accepted
 {
     LinkedListHelpers.Node node = new LinkedListHelpers.Node('E');
     node.deleteAllMMoreThanTwoSame(default(Char));
 }