Any one got NUnit running with the micro framework? Id really like to have this option for testing.
NUnit with the micro framework
Started by sebastianpatten, Feb 22 2011 08:59 PM
2 replies to this topic
#1
Posted 22 February 2011 - 08:59 PM
#2
Posted 23 February 2011 - 03:49 AM
http://nunitlite.org...x.php?p=roadmap is what i am waiting for.
I have been meaning to try another approach in my projects while I wait for nunitlite to come out. I was going to separate my I/O classes from the classes that do the business logic. That way I can use the full version of NUnit and simply add the business logic class files by link to my test project. Since they wouldn't have any dependencies on the I/O it should work. I was going to use interfaces to hook the I/O layer to the business layer, that way I could mock out the I/O dependency. At least I could unit test the business logic that way.
Another approach I have thought of is that you could use an emulator as a test harness.
#3
Posted 23 February 2011 - 10:13 AM
I found the key was that the testing framework needed to be microframework code. I started using an emulator as a test harness and writing a simple NUnit equivalent in .NETMF, but got distracted and abandoned it.
I still write code to be testable. I just test stuff by pasting some debug.prints into Main() and removing or commenting them out when it's working. Clunky, but it does the job.
To be honest, the most complicated part of what I've been doing has been interfacing to hardware and getting protocols working. Not stuff I can unit test. e.g. I'm trying to get "hello world" displaying on a serial LCD. No point unit testing the class that sends the bytes over the com port. The text either displays or not and the error may well be in my soldering.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users