Running tests
There are two ways to run tests.
- Method 1: Using IntelliJ JUnit test runner
- To run all tests, right-click on the
src/test/java
folder and choose Run 'All Tests'
- To run a subset of tests, you can right-click on a test package,
test class, or a test, for example
parse_unknownCommandWord_returnsHelp
in athena.ParserTest
and choose Run ParserTest.parse_unknownCommandWord_returnsHelp
- Method 2: Using Gradle
- Open a console and run the command
gradlew clean test
(Mac/Linux: ./gradlew clean test
)
Types of tests
This project has three types of tests:
- Unit tests targeting the lowest level methods/classes.
e.g. athena.task.TaskTest
- Integration tests that are checking the integration of multiple code units (those code units are assumed to be working).
e.g. athena.commands.AddCommandTest
- Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
e.g. <don’t have this for now>