0

NUnitLite is really useful for Autocad/Bricscad plugin testing, because i can load plugin, and then manually, from inside of an assembly, invoke tests new AutoRun().Execute(nunitArgs); Thanks to CADbloke github repository for tutorial on how to do this.

NUnitLite test results are saved to a xml file and can be converted to HTML (ReportUnit or ExtentReports ) and opened with browser.


Is there a way to connect NUnitLite with Visual Studio 2019 Test Explorer or to NUnit GUI, so i can automatically see results there? Or some non automatic way?

Bonus question: Is it possible to manually invoke NUnit tests (from assembly) in other way than using NUnitLite?

Thanks

miki
  • 380
  • 6
  • 15

2 Answers2

1

This is one of the key use cases for which NUnitLite is designed. Unfortunately, since NUnitLite is nothing more than a console application, there is no way for it to transmit test results back to TestExplorer. It would have to be enhanced to function as some sort of agent using a communications channel - not impossible but definitely non-trivial, especially when used "inside" your AutoCad plugin.

Charlie
  • 12,928
  • 1
  • 27
  • 31
  • Thanks for answer, things are more clear now! Anyway, NUnitLite is really a rescuer. I will make another answer with some details for future readers. – miki Nov 04 '19 at 19:03
0

After some research on the topic, i decided to share information i have found for future readers (and maybe future me :) )

Since NUnitLite outputs .xml file with test results, my idea was to somehow load and show these results to Test Explorer in Visual Studio. I have found some articles which explain how to do it, and basically you need to create Test Adapter - it loads data from .xml file and doesn't run any tests, but returns test results (looks like mocking tests - we can't just load results into Test Explorer).

I decided not to go further for now because: 1) i am not sure how much time will be needed, 2) i will get only readonly test results, without possibility to use features of Test Explorer - and this already exists as html preview.


Here are some blogs that could be helpful:

Of course check NUnit test adapter, it is adapter that works:

And some forum posts, with useful information:

miki
  • 380
  • 6
  • 15