A simple project to practice writing JUnit 5 tests.
This short guide describes:
This starter project uses the Java programming language.
Before getting started, ensure you have Java 17 LTS (or higher) installed locally. The following commands should output the version of Java installed.
$ javac -version
javac 17.0.4
$ java -version
openjdk version "17.0.4" 2022-07-19 LTS
OpenJDK Runtime Environment Zulu17.36+13-CA (build 17.0.4+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.36+13-CA (build 17.0.4+8-LTS, mixed mode, sharing)
Clone this repository locally, then create a branch to work on.
git clone git@github.com:CodingBlackFemales/the-calculator.git
cd the-calculator
git checkout -b ${your-branch-name}
Next, install the project dependencies and validate your project by running the following command at the root of your project:
./mvnw clean validate
If you are on a Windows machine, that will be:
mvnw clean validate
You should see the following console output:
$ ./mvnw clean validate
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.codingblackfemales:the-calculator >-----------------
[INFO] Building the-calculator 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ the-calculator ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.155 s
[INFO] Finished at: 2022-11-03T20:56:09Z
[INFO] ------------------------------------------------------------------------
Write tests to ensure the Calculator can multiply two numbers.
Think of all possible scenarios, and write a test for each of the scenarios.
Write tests to ensure the Calculator can divide two numbers.
Think of all possible scenarios, and write a test for each of the scenarios.
One of the scenarios should encover a flaw in the Calculator implementation.
Add more scenarios to cover the Calculator’s addition and subtraction functionalities.
Enjoy working on your exercise! 😃