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?
Unit Testing Netduinos
Started by JamieDixon, Feb 20 2012 02:40 PM
1 reply to this topic
#1
Posted 20 February 2012 - 02:40 PM
#2
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