Skip to content

Commit

Permalink
Update GridTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
cokeisthebest authored May 1, 2024
1 parent 98c4d22 commit 1c4a92f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/test/java/com/group23/wurdle/GridTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,46 @@ public void gridUnder1Second() throws Exception {

}


@Test
public void testWordExistsHorizontal() {
// Create a new grid
Grid grid = new Grid(5, 5);
// Create a GridGen object
GridGen generator = new GridGen();
generator.addWordToGrid("TEST", grid);
assertTrue(GridGen.wordExists("TEST", grid)); // Verify if the word "TEST" exists horizontally in the grid
}

@Test
public void testWordExistsVertical() {
// Create a new grid
Grid grid = new Grid(5, 5);
// Create a GridGen object
GridGen generator = new GridGen();
generator.addWordToGrid("TEST", grid);
assertTrue(GridGen.wordExists("TEST", grid)); // Verify if the word "TEST" exists vertically in the grid
}

@Test
public void testWordExistsDiagonalUp() {
// Create a new grid
Grid grid = new Grid(5, 5);
// Create a GridGen object
GridGen generator = new GridGen();
generator.addWordToGrid("TEST", grid);
assertTrue(GridGen.wordExists("TEST", grid)); // Verify if the word "TEST" exists diagonally up in the grid
}

@Test
public void testWordExistsDiagonalDown() {
// Create a new grid
Grid grid = new Grid(5, 5);
// Create a GridGen object
GridGen generator = new GridGen();
generator.addWordToGrid("TEST", grid);
assertTrue(GridGen.wordExists("TEST", grid)); // Verify if the word "TEST" exists diagonally down in the grid
}


}

0 comments on commit 1c4a92f

Please sign in to comment.