开发者

NUnit with Windows Phone 7 [closed]

开发者 https://www.devze.com 2023-01-14 08:38 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to开发者_JS百科 solve it.

Closed 8 years ago.

Improve this question

I'd like to unit test my Windows Phone 7 libraries with NUnit.

Is there a version of NUnit compatible with Windows Phone 7?


You might also look at http://unitdriven.codeplex.com - it is a Silverlight and WP7 unit test framework/runner, that also has an add-in DLL for nunit/mstest so you can write tests and have the same test code run in .NET, Silverlight and WP7.

As long as you are testing non-async behaviors, UnitDriven is pretty compatible with nunit (we built it to run a few hundred pre-existing nunit tests). It does have its own model for async tests - again specifically designed so the same test code runs in .NET, SL and WP7.


What you are searching for is nunit-silverlight. You need to reference "NUnit.Silverlight.Framework.dll" and "NUnit.Silverlight.Compatibility.dll" (SilverLight 3 versions), and make all references "local copy", even the .NET framework.

If you use Visual Studio Express Edition, there is still some obstacles that I detailed a bit more on my blog. In short: Express Edition doesn't include tests or add-ins, and it should work fine with external test runners but for my part I've got an exception in NUnit's GUI, so one may need something else to run his tests (NUnit-Console, Gallio, Autotest.NET, ...). I use TddBarForPhone (available on codeplex), a tool I made which runs NUnit-Console after each build and color the results in red or green.


As Windows Phone 7 is basically just Silverlight 3 I suspect that it will be fine.

There are multiple posts about using NUnit with Silverlight, so give them a try and you will probably have lots of success.

Here is one on using TestDriven.Net and NUnit with Silverlight: http://weblogs.asp.net/nunitaddin/archive/2008/05/01/silverlight-nunit-projects.aspx


I have recently discoverted the following tools which can be additionaly helpful for CI-Integration.

http://justinangel.net/WindowsPhone7EmulatorAutomation

and more on that (which is a series of articles having 5 parts actually): http://blogs.msdn.com/b/vsdteam/archive/2007/11/20/corecon-api-part-1.aspx


I found a great screencast recently that shows how to wire up NUnit so you can tdd on the Windows Phone 7 platform.

It's not using any silverlight templates/etc just a plain WP7 class library and NUnit


I've had a port of this ready for a while and finally uploaded it to NuGet.org

Install-Package NUnit.WP

NuGet package: http://www.nuget.org/packages/NUnit.WP

Source: http://bitbucket.org/jesperll/nunit-silverlight

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号