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

Unit Testing Netduinos


  • Please log in to reply
1 reply to this topic

#1 JamieDixon

JamieDixon

    Member

  • Members
  • PipPip
  • 25 posts
  • LocationCary, NC

Posted 20 February 2012 - 02:40 PM

Has anyone converted a Netduino Console Application into a Class Library, added Unit Testing (MSTest built into VS2010), and run a test succesfully? I took the intro program in the Getting Started Guide and got it to run. I then converted the Console app to a class library. I renamed the main function and remove the static keyword. When I added the test project to the solution, I got this: Warning 1 The project 'Tff.NetduinoExamples' cannot be referenced. The referenced project is targeted to a different framework family (.NETMicroFramework) I then tried to run the test and I got this: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SPOT.Hardware, Version=4.1.2821.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF. The class library is pointed at the emulator. Any ideas?

#2 Peter Hageus

Peter Hageus

    New Member

  • Members
  • Pip
  • 1 posts

Posted 09 March 2012 - 01:25 PM

Unit ests are run on your pc, not on the device. What I've done is I've extracted all the hw/micro/netduino-specific bits into their own classes. Then you can use Add existing file, Add as link for the remaing classes to your test-project, create mocks for hw-specifics and test away.




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.