我正在研究 C# 程序、VS2015、R#、Nunit。我有 Nunit 测试
[ 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 测试运行器使用的案例:
我做错了什么?