Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

NUnit with the micro framework


  • Please log in to reply
2 replies to this topic

#1 sebastianpatten

sebastianpatten

    Member

  • Members
  • PipPip
  • 21 posts

Posted 22 February 2011 - 08:59 PM

Any one got NUnit running with the micro framework? Id really like to have this option for testing.

#2 Mike L

Mike L

    Advanced Member

  • Members
  • PipPipPip
  • 48 posts

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 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

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

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.