This tutorial shows a general way to apply the tests in this repo
First I want to mention that this highly depends on your configuration (OS, IDE).
The first thing you have to check is that Verify that git is installedgit is installed on your system. You can check this by opening a command prompt and by typing 'git'. + **On windows** git isn't installed by default + **On linux and mac** git is mostly installed by default
Now you can get the test-code. It is recommended to use IntelliJ.
If you are using IntelliJ its really easy to get the tests running. Setup for IntelliJ
First you have to go to the start window of IntelliJ (close any opened project). Download and import the files in a project
There you can click on Check out from Version Control and select git.
In there you can paste in the git link of this repo: https://git.scc.kit.edu/WS-17-18/assignment-tests.git
If you edit the Parent Directory here you may have to edit it later when creating the project.
Click clone. You may have to log in with your Account.
IntelliJ now asks you to create a new Project. Click yes.
You can continue clicking next until you have to select the Project SDK. There you have to add your JDK by telling IntelliJ where to find it.
After that click next and then finish. Your project will now be created and opened.
Before you can start testing you have to add **JUnit 5.0** to the class-path of your project. To do this open **assignment-tests>src>test>TestBase.java**, navigate your cursor to the top of the file, where JUnit is imported, and hit ALT+ENTER where the text is red. Then select **JUnit 5.0**. Setup the new project
The project should compile now. You can verify this by pressing CTRL+F9 (Build Project).
Now you have to link your project for testing. Basically, there are 2 ways to do this: 1. Copy all your `.java` source files into the `edu.kit.informatik` package 2. Add your project as a module dependency to the test project. To do this, go to **File** -> **Project Structure** -> **Modules** -> **+** -> **Import Module...** and select your project. Then select **assignment-tests** -> **Dependencies** -> **+** -> **Add module dependency...** and select your project. Hit **apply** and you should be good to go. Link your files
Before you can run a test, you have to tell it what to test. This can be done by editing the **extended** class of the provided **DummyMain** in the according directory of the test. Run tests
To run all tests in a folder or class right-click on it and select 'Run Tests ...'.
To get the newest tests available, you have to update the project. Keep the project up to date
For this you have to find the VCS-tool in the menu-bar. This is the git plugin for IntelliJ.
In there you just have select Updated Project... and everything will be up to date.
Note: If you want to keep your DummyMains, you have to follow the instructions in the comments there!
Someone may want to add a tutorial for this in **Eclipse** here. Setup for Eclipse
Setup for manual building or for an different IDE
Open a command prompt in a folder where you want to download the repo. + If you are on **Linux or Mac** you should know how this works + If you are on **Windows** you can open one by navigating to the folder in the explorer and by selecting 'File->Open Command Line' or 'File->Open Powershell' Clone this repository using a command prompt
You now can download the repo by typing in 'git clone https://git.scc.kit.edu/WS-17-18/assignment-tests.git'. You may have to log in with your Account.