PC Review


Reply
Thread Tools Rate Thread

Compact Framework MSTest unit testing.

 
 
drozd
Guest
Posts: n/a
 
      28th Jul 2009
Hi,

How do you approach managing MSTest unit tests in smart device
projects (VS2008)?

Do you keep 2 separate test projects
- one set up to reference the smart device test framework
- another using the full framework one
with shared unit tests added as links to the other project.

Or do you only maintain one project and two separate test run config
files?

So far I've been going with the first approach, but it's really
annoying to have to "Add as link.." every time I add a new test class
and also to constantly unload/reload one of the projects (because VS
doesn't like tests with the same name/id loaded at the same time).

The problem with the second approach is that you can't really use the
TestContext in the test classes, because running the tests with the
other test run config will get you:
" System.ArgumentException: Object of type
'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext'
cannot be converted to type
'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext"

What's your take on this?

Best regards,
Michal
 
Reply With Quote
 
 
 
 
Chris Tacke, MVP
Guest
Posts: n/a
 
      28th Jul 2009
I'm not clear why you need the desktop test application. We use MSTest a
lot, and we simply have a device unit test project with a single
testrunconfig file.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


"drozd" <(E-Mail Removed)> wrote in message
news:9793a2d0-0771-466f-8ba9-(E-Mail Removed)...
> Hi,
>
> How do you approach managing MSTest unit tests in smart device
> projects (VS2008)?
>
> Do you keep 2 separate test projects
> - one set up to reference the smart device test framework
> - another using the full framework one
> with shared unit tests added as links to the other project.
>
> Or do you only maintain one project and two separate test run config
> files?
>
> So far I've been going with the first approach, but it's really
> annoying to have to "Add as link.." every time I add a new test class
> and also to constantly unload/reload one of the projects (because VS
> doesn't like tests with the same name/id loaded at the same time).
>
> The problem with the second approach is that you can't really use the
> TestContext in the test classes, because running the tests with the
> other test run config will get you:
> " System.ArgumentException: Object of type
> 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext'
> cannot be converted to type
> 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext"
>
> What's your take on this?
>
> Best regards,
> Michal


 
Reply With Quote
 
drozd
Guest
Posts: n/a
 
      29th Jul 2009
Don't you find running the device tests take a lot of time? With
deploying to the device/emulator and getting the results back?

Running the tests using the desktop test runner is much faster in our
case, so we run them on the device less frequently along with
integration tests.

On Jul 28, 5:40*pm, "Chris Tacke, MVP" <ctacke.at.opennetcf.dot.com>
wrote:
> I'm not clear why you need the desktop test application. *We use MSTesta
> lot, and we simply have a device unit test project with a single
> testrunconfig file.
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Giving back to the embedded communityhttp://community.OpenNETCF.com
>
> "drozd" <drozdow...@gmail.com> wrote in message
>
> news:9793a2d0-0771-466f-8ba9-(E-Mail Removed)...
>
>
>
> > Hi,

>
> > How do you approach managing MSTest unit tests in smart device
> > projects (VS2008)?

>
> > Do you keep 2 separate test projects
> > - one set up to reference the smart device test framework
> > - another using the full framework one
> > with shared unit tests added as links to the other project.

>
> > Or do you only maintain one project and two separate test run config
> > files?

>
> > So far I've been going with the first approach, but it's really
> > annoying to have to "Add as link.." every time I add a new test class
> > and also to constantly unload/reload one of the projects (because VS
> > doesn't like tests with the same name/id loaded at the same time).

>
> > The problem with the second approach is that you can't really use the
> > TestContext in the test classes, because running the tests with the
> > other test run config will get you:
> > " System.ArgumentException: Object of type
> > 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext'
> > cannot be converted to type
> > 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext"

>
> > What's your take on this?

>
> > Best regards,
> > Michal


 
Reply With Quote
 
Chris Tacke, MVP
Guest
Posts: n/a
 
      29th Jul 2009
Yes, they're painfully slow on the device, and you can't debug them either,
which makes them actually far less useful than they should be, but no, we
don't run them on the desktop. My typical cycle is that I have a console app
test harness (yes, really) that I use to write and debug the tests. One
that works, I convert it to a true unit test and check it in. Once checked
in, the speed is far less of an issue, since the TFS server just auto-runs
all of them on every check-in. Basically we're relegated them to being for
testing regression, not for an entry point for development (which is how I
use them on the desktop).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com



"drozd" <(E-Mail Removed)> wrote in message
news:94898fc3-80f3-46a7-a1de-(E-Mail Removed)...
Don't you find running the device tests take a lot of time? With
deploying to the device/emulator and getting the results back?

Running the tests using the desktop test runner is much faster in our
case, so we run them on the device less frequently along with
integration tests.

On Jul 28, 5:40 pm, "Chris Tacke, MVP" <ctacke.at.opennetcf.dot.com>
wrote:
> I'm not clear why you need the desktop test application. We use MSTest a
> lot, and we simply have a device unit test project with a single
> testrunconfig file.
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Giving back to the embedded communityhttp://community.OpenNETCF.com
>
> "drozd" <drozdow...@gmail.com> wrote in message
>
> news:9793a2d0-0771-466f-8ba9-(E-Mail Removed)...
>
>
>
> > Hi,

>
> > How do you approach managing MSTest unit tests in smart device
> > projects (VS2008)?

>
> > Do you keep 2 separate test projects
> > - one set up to reference the smart device test framework
> > - another using the full framework one
> > with shared unit tests added as links to the other project.

>
> > Or do you only maintain one project and two separate test run config
> > files?

>
> > So far I've been going with the first approach, but it's really
> > annoying to have to "Add as link.." every time I add a new test class
> > and also to constantly unload/reload one of the projects (because VS
> > doesn't like tests with the same name/id loaded at the same time).

>
> > The problem with the second approach is that you can't really use the
> > TestContext in the test classes, because running the tests with the
> > other test run config will get you:
> > " System.ArgumentException: Object of type
> > 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext'
> > cannot be converted to type
> > 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext"

>
> > What's your take on this?

>
> > Best regards,
> > Michal


 
Reply With Quote
 
Simon Hart [MVP]
Guest
Posts: n/a
 
      6th Oct 2009
I think you're over complicating this. You need to ask yourself, "does my
code need to be run on a device?" if the answer is no - and it usually is
no, as few people actually test UI code, then simply setup a device test
project(s) that runs on the desktop. Usually integration tests run as a
nightly build anyway.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://www.simonrhart.com

"drozd" <(E-Mail Removed)> wrote in message
news:9793a2d0-0771-466f-8ba9-(E-Mail Removed)...
> Hi,
>
> How do you approach managing MSTest unit tests in smart device
> projects (VS2008)?
>
> Do you keep 2 separate test projects
> - one set up to reference the smart device test framework
> - another using the full framework one
> with shared unit tests added as links to the other project.
>
> Or do you only maintain one project and two separate test run config
> files?
>
> So far I've been going with the first approach, but it's really
> annoying to have to "Add as link.." every time I add a new test class
> and also to constantly unload/reload one of the projects (because VS
> doesn't like tests with the same name/id loaded at the same time).
>
> The problem with the second approach is that you can't really use the
> TestContext in the test classes, because running the tests with the
> other test run config will get you:
> " System.ArgumentException: Object of type
> 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext'
> cannot be converted to type
> 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext"
>
> What's your take on this?
>
> Best regards,
> Michal


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running unit tests for compact framework applications aryaabraham Microsoft Dot NET Compact Framework 7 21st Feb 2010 02:01 AM
VB.NET, Unit testing and .NET Framework book recommendation gamesforums@hotmail.com Microsoft VB .NET 3 31st Oct 2007 04:02 AM
Unit Testing Methodology for Compact Framework Nathan Microsoft Dot NET Compact Framework 1 9th Dec 2005 09:54 PM
eMbedded Visual c++ v.4 and Unit Testing Framework c_xyTopa Microsoft Dot NET Compact Framework 0 6th Oct 2005 04:43 PM
Unit and Regression testing tools that work well for compact framework development Wiredless Microsoft Dot NET Compact Framework 2 13th Jun 2005 05:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 AM.