Revit.TestRunner - Run UnitTests in Revit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Developers,
In 2018 I start to program in Revit API environment. It was completely new to me, so I had to get familiar with the API and its peculiarities. I found the blog of @jeremytammik , which helped me a lot.
We insourced an addin, which was developed by an external company. The hole code lives in an assembly which references the Revit API. Then I realized, testing is hard. I refactured the code, that it was as much as possible independent from the Revit API. This Code was testable as I knew it, tests run on Contiguous Integration. But a lot of Code lasts on the Project referenced to Revit API.
I asked google what to do, but apparently there is not THE way how you solve this problem.
There is some stuff around (ex. RevitTestFramework) which seems cool, but I was not happy with it. At least all I found uses NUnit 2.6. But all my Revit independent Code is tested by the NUnit 3.x. The build server doesn’t like the mix.
As result, I started to write my own TestRunner using NUnit 3. It is far away from perfect, nevertheless I would like to share it with the community.
Please have a look at https://github.com/geberit/Revit.TestRunner
Features so far:
* Using NUnit 3
* No reference to Revit.TestRunner needed in test assembly
* Support of NUnit attributes SetUp and TearDown
* Injection of API objects in test method
* Works as an addin with GUI
* Installation script for libraries
* Post build event in VS project to place addin file
Feedback welcome
Tobias - Geberit Verwaltungs AG