views:

458

answers:

2

We are currently building the framework for developing a C# .net application using visual studio 2008.

We are considering our options wrt. the unit test code for this project.

One option is the Test Project in Visual studio. I need to clarify if these test projects will convert to 2010 correctly or any difficulties that may arise.

I have had no success searching for answers to this and would like any guidance you could provide.

Thanks!

I have found one issue with converting tests: https://connect.microsoft.com/VisualStudio/feedback/details/514130/visual-studio-2010-beta-2-silently-upgrades-mstest-test-projects-to-net-4-0

which is of concern, but still not sure of other issues?

+3  A: 

VS2010 can only run .NET 4.0 tests. If for some reason you need to run your unit tests from previous version of VS - you might have a problem.

If the code in your tests will run as .NET 4.0 flawlessly you shouldn't have any problems.

Why not do a small spike - try to convert some of your tests and see if it works?

Dror Helper
Thanks for the info!
Russell
#Russel - you're welcome - in fact Iwrote a "rant" about it in my blog: http://blogs.microsoft.co.il/blogs/dhelper/archive/2010/04/13/why-support-more-the-story-of-mstest.aspx
Dror Helper
+1  A: 

I Ran into an issue with this! The work around is no good. This is because my unit tests used Linq to Entities which has changed since 3.5 to 4.0 and my tests ran flawlessly but when I deployed to test environment I got this error "Unable to create a constant value of type 'Closure type'. Only primitive types ('such as Int32, String, and Guid') are supported in this context."

I had to go back and change my linq queries and go back to using VS 2008 to run tests. :S What is up with this, Microsoft?

Harshal