Ejemplo n.º 1
0
        public void ReplaceThreeFives_ReplacesThreeFivesWithPingPong_ThreeFiveIsPong()
        {
            // Arrange
              int nextNumber = 15;
              ArrayList testThreeFivesList = new ArrayList();
              testThreeFivesList.Add(1);
              testThreeFivesList.Add(2);
              testThreeFivesList.Add("ping");
              testThreeFivesList.Add(4);
              testThreeFivesList.Add("pong");
              testThreeFivesList.Add("ping");
              testThreeFivesList.Add(7);
              testThreeFivesList.Add(8);
              testThreeFivesList.Add("ping");
              testThreeFivesList.Add("pong");
              testThreeFivesList.Add(11);
              testThreeFivesList.Add("ping");
              testThreeFivesList.Add(13);
              testThreeFivesList.Add(14);
              testThreeFivesList.Add("ping-pong");
              int[] testArray = new int[15];
              testArray[0] = 1;
              testArray[1] = 2;
              testArray[2] = 3;
              testArray[3] = 4;
              testArray[4] = 5;
              testArray[5] = 6;
              testArray[6] = 7;
              testArray[7] = 8;
              testArray[8] = 9;
              testArray[9] = 10;
              testArray[10] = 11;
              testArray[11] = 12;
              testArray[12] = 13;
              testArray[13] = 14;
              testArray[14] = 15;

              // Act
              PingPongGenerator newGenerator = new PingPongGenerator(nextNumber);
              ArrayList resultThreeFivesList = newGenerator.ReplaceThreeFives(testArray);

              // Assert
              for (int i = 0; i < 15; i++) { Console.WriteLine(resultThreeFivesList[i]); }
              Assert.Equal(testThreeFivesList, resultThreeFivesList);
        }