2016-08-01 41 views
0

我在C#程序,VS2015,R#,Nunit上玩過。我有NUnit的測試Nunit TestCaseSource跳過一些案例

[ Test ] 
    [ TestCaseSource(typeof(GeneralTestCases), "TestStoresCredentials") ] 
    public void PingSoapAsync_IncorrectUrl_ThrowException(ServiceSoapCredentials credentials) 

[ Test ] 
    [ TestCaseSource(typeof(GeneralTestCases), "TestStoresCredentials") ] 
    public void PingSoapAsync_IncorrectApiUser_ThrowException(ServiceSoapCredentials credentials) 

GeneralTestCases是(有5例!!!):

public class GeneralTestCases 
{ 
    /// <summary> 
    /// GetTestStoresCredentials shoud return the same credentials as this method 
    /// </summary> 
    /// <returns></returns> 
    public IEnumerable TestStoresCredentials 
    { 
     get 
     { 
      yield return new TestCaseData(new BaseTest.MServiceSoapCredentials()).SetName("m1-9-2-0-ce"); 
      yield return new TestCaseData(new BaseTest.MServiceSoapCredentials()).SetName("m1-9-2-1-ce"); 
      yield return new TestCaseData(new BaseTest.MServiceSoapCredentials()).SetName("m1-9-2-2-ce"); 
      yield return new TestCaseData(new BaseTest.MServiceSoapCredentials()).SetName("m2-0-2-0-ce"); 
      yield return new TestCaseData(new BaseTest.MServiceSoapCredentials()).SetName("m1-8-1-0-ce"); 
     } 


    } 
} 

但是當我按下 「運行所有測試」 不Resharper測試跑步者使用的所有情況:

enter image description here

我做錯了什麼?

+0

如果使用NUnit本身運行測試會發生什麼? – Charlie

回答

0

此問題可能與您的測試跑步者有關。嘗試關閉當前的測試會話並從頭開始測試。 R#-> Unit Tests -> Run Unit Tests

相關問題