-
Notifications
You must be signed in to change notification settings - Fork 58
Create a unittest
saroele edited this page Nov 21, 2014
·
1 revision
Creating a unittest is not hard, so try to do it for every model you create. Here are the steps:
- Make an example for your model (a minimalistic model that can be simulated as such)
- Run a simulation with the inputs/simulation settings you would like to have in the unittest
- Make a plot of the variables you want to compare in the unittest. Every time the unittest will be run, you model will be simulated and the result will be compared with the reference result for each of these variables.
- Go to File/Generate Script
- Click on command log
- Save the
.mos
file that will contain the command log in the right place in the IDEAS/Resources/Scripts/... folder - Edit this file in a text editor and remove all lines before the line that simulated your model. Keep only the simulateModel() and plot() lines.
That's all. From now on, your example model will always be checked in the unittests.