Re: Could Nunit test work for Microsoft SmartDeviceC#project.
"Charlie Poole" <[email protected]>
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <002001c823bd$45d112e0$6401a8c0@FERRARI> |
Hi Michael, I just found this old thread while searching for something else. If you haven't yet come across NUnitLite, you may want to take a look, since it will integrate with future versions of NUnit. Charlie > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf > Of Michael Reppy > Sent: Wednesday, April 04, 2007 8:38 AM > To: Brad Stiles > Cc: [email protected] > Subject: Re: [Nunit-users] Could Nunit test work for > Microsoft SmartDeviceC#project. > > We also do this all the time. 95-99% of code seems works > exactly the same. But the small differences are are why we > we use CFNUnitBridge to test in the actual Compact Framework > environment. > > For instance: if you try and set the Text or Font properties > of a System.Windows.Forms.Panel object, it will work fine in > the desktop environment, but it will throw an exception when > executed in the compact framework environment. Now > admittedly there is a compiler warning against this, but in > this case that slipped by us until the CF test threw an exception. > > > -Mikey > > > > On Apr 4, 2007, at 7:30 AM, Brad Stiles wrote: > > >>> Could Nunit test work for Visual Studio 2005 Microsoft > Smart Device > >>> C# project? Such as some applications run on pocket PC. > >>> > >>> > >>> > >>> I develop a simple test project using Nunit2.2.9. When I > run it, I > >>> get Exception > > > >> Charlie Poole responded: > > > >> You would need a version of NUnit tailored to run under > the compact > >> framework. Some people have tried this and we (the NUnit project) > >> have plans to do it as well, but it doesn't exist now. > > > > If you are using only .NET Framework code, i.e. no third party > > libraries, you can often use the full framework version of NUnit to > > test Compact Framework code. > > > > I do this by creating a blank solution, then adding a Windows class > > library that I use for tests. This library references the full > > framework and NUnit. This will contain my unit tests. I > then add a > > Smart Device class library project to the same solution. This will > > contain my project code. Set a project reference in the > test project > > to the smart device class library project (you'll get a > warning from > > Visual Studio that this may cause problems; I've never had > a problem > > with the simple stuff I do for my handheld), and you're ready to go. > > > > This works because when you execute a Compact Framework > application on > > your desktop, all the calls are actually redirected to the full > > framework. Most third party libraries I've seen, even > those that have > > a CF version, don't do this redirection automatically, > though there's > > allegedly a way to make it happen. This essentially means that you > > are > > *mocking* the CF using the full framework, so be aware that > the code > > in your smart device library is *not* actually executing CF > code for > > the tests. However the compiler is still checking your > code against > > the Compact Framework so that you can't include stuff that the CF > > doesn't include. > > > > It's not a perfect solution, but it has worked for me so far. As I > > said, though, your code is *not* executing against the Compact > > Framework when you do this, so hopefully MS has tested that > they both > > do the same things when sent the same message. :) > > > > Brad > > > > > > > ---------------------------------------------------------------------- > > --- > > Take Surveys. Earn Cash. Influence the Future of IT Join > > SourceForge.net's Techsay panel and you'll get the chance to share > > your opinions on IT & business topics through brief > surveys-and earn > > cash http://www.techsay.com/default.php? > > page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Nunit-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/nunit-users > > > -------------------------------------------------------------- > ----------- > Take Surveys. Earn Cash. Influence the Future of IT Join > SourceForge.net's Techsay panel and you'll get the chance to > share your opinions on IT & business topics through brief > surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge > &CID=DEVDEV > _______________________________________________ > Nunit-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/nunit-users > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/