2015-10-01 47 views
0

我們已經將VS2008解決方案升級到VS2010,然後升級到VS2013 Pro。在VS2013這一切建立,但單元測試都失敗,相同的錯誤:VS2008-> VS2013升級後的解決方案無法再運行測試

The unit test adapter failed to connect to the data source or read the data.

的文件夾結構並沒有改變,而測試數據文件都在那裏在正確的位置。

下面是一個典型的測試:

[DeploymentItem(@"Autoscribe.Utility.Test\TestData\GetParameters1_RetrievesCorrectParameters.xml")] 
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", @"|DataDirectory|\Autoscribe.Utility.Test\TestData\GetParameters1_RetrievesCorrectParameters.xml", "test-record", DataAccessMethod.Sequential)] 
[TestMethod(), Description("String extensions")] 
public void GetParameters1_RetrievesCorrectParameters() 
{ 
    // Get test data. 
    string input = TestContext.DataRow["input"].ToString(); 
    string[] outputs = TestContext.DataRow["outputs"].ToString().Split(new char[] { ',' }, StringSplitOptions.None); 

    // etc 
} 

在VS2008中有一個嚮導來設置測試屬性連接測試數據文件測試,並使用該往往是固定的這一類的問題,但是這並未在VS2013 Pro中似乎不可用。誰能告訴我:

一)如何在VS2013的測試連接到數據文件臨而無需顯式輸入的DataSource屬性,

b)就如何解決這個問題有什麼建議?

回答

0

訣竅是明確選擇原始的testrun配置。看來升級並沒有推動這一進展。

相關問題