haughtonomous
haughtonomous

Reputation: 4850

Unit test wion't execute under VS2013

I have a number of unit tests in my solution that won't execute under VS2013. They all generate an error message along the following lines:

[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", @"|DataDirectory|\Scheduler\Test Projects\Intra-Matrix Scheduler Tests\TestData\ScheduledDate_AbsoluteDates.xml", "test-record", DataAccessMethod.Sequential)]       public void MatrixUserTaskScheduledDate_GetNextConcreteDateTimeForAbsoluteDates_CanSuccessfullyGetDate() 

UTA049: Intra_Matrix_Scheduler_Tests.MatrixUserTaskScheduledDateTests.MatrixUserTaskScheduledDate_GetNextConcreteDateTimeForAbsoluteDates_CanSuccessfullyGetDate has invalid DataSource attribute. Either DataSourceSettingName or ConnectionString and TableName must be specified and cannot be empty.

This wasn't an issue in VS2008. I can't see why the error should be generated - the connection string and tablename are there, and intellisense seems to confirm this.

Can anyone suggest what is wrong? We have hundreds of tests with the same issue, all of which ran quite happily under VS2008.

TIA

Upvotes: 0

Views: 290

Answers (1)

demoncodemonkey
demoncodemonkey

Reputation: 11957

It seems that you've upgraded from VS2008 to VS2013, I'm guessing something went wrong with the project upgrade process. I've noticed that if I create a new unit test project in VS2013, it adds a load of "Microsoft.VisualStudio.TestTools" related stuff in the project file.

(actually I don't need that stuff because I'm using NUnit but anyway...)

The way to figure this out would be to create a brand new unit test project in your solution, and add one of the failing tests to it. If it passes in your new test project then you know there's something dodgy with your old project. In which case you should either move all your tests into the new project, or figure out what's different between the two .csproj files, and apply that change to your old project.

Upvotes: 1

Related Questions