PGdP-Tests-WS21/22 is a student-created repository used to share code tests.
Due to the end of this module, this repository will be closed down. Special shoutout to everybody, who was involved in this project.
Es ist alles erlaubt, was die Lösung nicht verrät.
The so-called Übungsleitung will have an eye on this repository. But as long as the tests do not reveal the solution of the homework, this repository will be tolerated. To ensure the solution is not getting revealed, the tests should be Input/Output-Tests.
The Übungsleitung is not responsible for this repository. Therefore no support is given by the Übungsleitung. Just use the Issue feature here.
correct:
// Test Area calculation
// Arrange
Rectangle r1 = new Rectangle(length: 4, width: 4)
// Act & Assert
assertEquals(16, r1.calculateArea());
wrong!:
// Test Area calculation
// Arrange
Rectangle r1 = new Rectangle(length: 4, width: 6)
// Act & Assert
// Calculate using length * width // <-- reveales the solution
assertEquals(4*6, r1.calculateArea()); // <-- reveales the solution
- Clone this repository
git clone https://github.com/LadnerJonas/PGdP-Tests-WS21-22.git
- Check for updates
git pull
-
Add the test folder to your
src
-folder of your artemis java projectOr use the syslink instruction below.
-
Make sure your IDE (e.g. IntelIJ or Eclipse) sees your added files
-
Include JUnit to your Project by pressing the red lightbulb (or
ALT + ENTER
in IntelIJ) on one of the red underlined @Test Annotations in the test file.
- Do not add them to your artemis git repository
- Run the tests and check your mistakes
As this is a student-driven project please keep in mind that mistakes can happen. If you think a test is wrong, please feel free to open an Issue (it is easy!). To help fixing bugs, please add following info to your Issue:
- Operating system
- IDE (IntelIJ, Eclipse, ...)
- Where is the mistake / error
- Citation of the homework instruction
This has to be executed in the command line, run as administrator:
$ mklink /d \path\to\src\tests \path\to\repository\tests
$ ln -s /path/to/repository/tests /path/to/src/
Shoutout to the Contributors of the TUM_GAD_Tests_SS21-Repository for this great tip!
- Fork Repository (Github Documentation)
- Add / edit tests under
<EXERCISE>/src/test
- Ensure no solution or homework-code is getting revealed
- Commit and push to your fork repository
- Open a Pull Request to this repository (Github Documentation)
- Wait until the changes are merged
Write Tests using JUnit 5
How to use Git
How to use Github
Feel free to contact me via email, but consider using google beforehand: