Add unit tests for generateNumberToBeGuessed() and isCorrectGuess() methods

- Verified structure and value bounds of generateNumberToBeGuessed()
- Tested correct and incorrect input behavior of isCorrectGuess()
- Set up JUnit 5 with @BeforeEach for Game instantiation
- Improved test readability with @DisplayName annotations
This commit is contained in:
2025-03-23 12:55:32 -05:00
commit 93008219c2
10 changed files with 307 additions and 0 deletions

36
pom.xml Normal file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>derek.guessinggame</groupId>
<artifactId>guessing-game-test</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency><!-- JUnit 5 -->
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Enables test discovery -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</build>
</project>