Delen via


Unit Testing for .Net Compact Framework

This blog post should have happened some time ago and the only reason it has taken so long is due to my laziness :-)

With the recent Visual Studio Orcas CTPs, we are shipping preview bits of one of the biggest features Visual Studio for Devices has to offer for Orcas - unit testing for NetCF applications. 

We would love to get feedback/britbats. Note that these are very, very early bits - so please be gentle :-). Here's how you can try it out. Leave a comment or mail any feedback to sriramk at microsoft.com.

 
Preparation

-  Download the CTP

- Make sure your target device or emulator already has NetCF v2 installed. We will *not* deploy it automatically. The easiest way to do this is to simply deploy a v2 project

Steps to run your first device unit test

- Create a NetCF v2 project. Can be anything other than Console Application (we have a bug around Console Applications that will be fixed in the next release)

- On any method, right-click and choose 'Create Unit Tests'

- From the dialog that pops up, choose 'Create a new Smart Device Visual C# Test Project' (or the equivalent VB one). Go ahead and create the test project.

- You should now see a spanking new test project. Go ahead and type in your unit test code. You know you want to :-)

- Click on Test->Windows->Test Manager. You should see a list of all your unit tests.

- Check 'All Loaded Tests'

- Click on 'Run Checked Tests' (the button with the green arrow)

- Voila! Your tests should run and you'll see the results in the test results window

 

Sriram Krishnan 

Comments

  • Anonymous
    November 12, 2006
    Great post - This is a significant step forward for mobile developers.  I've made a couple of comments here (http://community.softteq.com/blogs/nick/archive/2006/10/25/207.aspx) and here (http://community.softteq.com/blogs/nick/archive/2006/10/23/197.aspx) about the Orcas CTPs for mobile developers

  • Anonymous
    November 12, 2006
    En otro post ya había comentado la posiblidad de realizar Unit Test para nuestros desarrollos

  • Anonymous
    November 14, 2006
    Con la salidad de Orcas NUnit será posible en el .NET Compact Framework 2. Puedes descargar la imagen

  • Anonymous
    November 14, 2006
    Con la salidad de Orcas NUnit será posible en el .NET Compact Framework 2. Puedes descargar la imagen...

  • Anonymous
    March 16, 2007
    Visual Studio Orcas为智能设备开发带来一个十分有用的功能,就是可以对NetCF V2应用程序进行单元测试。

  • Anonymous
    March 28, 2007
    Visual Studio for Devices features in Orcas

  • Anonymous
    April 25, 2007
    Unless you've been living under a rock, you're probably aware that we shipped Visual Studio Orcas Beta1

  • Anonymous
    May 23, 2007
    Hola amig@s , Mientras apuro mi última hora de la jornada laboral, instalando VS 2003 para pelearme con

  • Anonymous
    February 24, 2008
    Unless you've been living under a rock, you're probably aware that we shipped Visual Studio Orcas