BlueM.DLLAdapterTest: Difference between revisions
(Note about Release configuration) |
(Add info on test datasets) |
||
Line 1: | Line 1: | ||
{{BlueM.Sim_nav}} | {{BlueM.Sim_nav}} | ||
'''BlueM.DLLAdapterTest''' is an assembly for running unit tests for [[BlueM.Sim]] and [[BlueM.DLLAdapter]] within Visual Studio. | '''BlueM.DLLAdapterTest''' is an assembly for running unit tests for [[BlueM.Sim]] and [[BlueM.DLLAdapter]] within Visual Studio. | ||
==Getting the test datasets== | |||
The test datasets used by the unit tests are available here: https://github.com/bluemodel/BlueM.Datasets/tree/master/BlueM/TESTS | |||
This folder needs to be copied to <code>BlueM.DLLAdapter\BlueM.DllAdapterTest\TESTS</code> in order for the tests to work. This may be solved differently in future, see [https://github.com/bluemodel/BlueM.DLLAdapter/issues/10 #10] | |||
==Running tests== | ==Running tests== | ||
[[File:BlueM.DLLAdapterTest_VS2019.png|thumb|right]] | |||
In Visual Studio, open the ''Test Explorer'', which will autodetect the tests defined within the loaded project. | In Visual Studio, open the ''Test Explorer'', which will autodetect the tests defined within the loaded project. | ||
Latest revision as of 01:47, 4 March 2023
BlueM.Sim | Download | Application | Theory | Development
BlueM.DLLAdapterTest is an assembly for running unit tests for BlueM.Sim and BlueM.DLLAdapter within Visual Studio.
Getting the test datasets
The test datasets used by the unit tests are available here: https://github.com/bluemodel/BlueM.Datasets/tree/master/BlueM/TESTS
This folder needs to be copied to BlueM.DLLAdapter\BlueM.DllAdapterTest\TESTS
in order for the tests to work. This may be solved differently in future, see #10
Running tests
In Visual Studio, open the Test Explorer, which will autodetect the tests defined within the loaded project.
Note that the assembly BlueM.DLLAdapterTest containing the unit tests is only configured to automatically build in the Debug configuration, so either use this configuration or, to test the Release version, force a build of BlueM.DLLAdapterTest by right-clicking it in the solution explorer.
You can then run all or just individual tests. To debug tests, right-click on a test and select Debug Test or choose Debug All Tests from the main Test menu.
Writing tests
To write new tests, copy the pattern of the already existing tests or read the documentation here: https://docs.microsoft.com/en-us/visualstudio/test/unit-test-your-code?view=vs-2019