#Unit test seems to just run the Main() function of my Nano project and not the unit test I created..

1 messages ยท Page 1 of 1 (latest)

radiant marsh
#

I created a unit test and when I Run or Debug the test it dosnt execute. The output looks like only the Nano projects Main function is called instead of my test. Did I mess something up somehow? I was trying to create unit tests for classes outside the one that runs the device.

amber hull
#

You can't debug nano Unit Tests. Have to use VS test explorer or the vstest command line to execute. Then look at the run outcome. Full output log is available

#

make sure the runsettings file is found and sits at the correct location to be found

#

you can check any of our class libs that have unit tests

normal vortex
#

Yep, I came across this. My workaround is to put all my testable code in a separate project (nf class library) and execute unit tests against it. The main project (nf application) contains just minimum wire-up code.

radiant marsh
#

I like that

#

Non device specific code should probably be that way anyway

normal vortex
midnight haven
#

If you really want to debug your tests, then you need to use project reference by cloning the test framework. In the project itslef, you have an example as it's used to debug the framework itself ๐Ÿ˜‰

#

Otherwise, yes, a good practice is to split over the project

#

And note as well that you can use the unit as a normal project as well, if you are really lazy, just copy the "main" from the unit test framework, and that's your main. Debug is then possible

normal vortex
midnight haven
#

๐Ÿ˜‰