我正在寻找一种使用 TestCase 将 keyValuePair 传递给我的测试的方法
[TestCase<KeyValuePair<int,string>>(1,"XX")]
public void someTest(KeyValuePair<int,string> expectedkeyValuePairs)
{
// do some thing;
}
答案是
[TestCase(1,"XXX")]
public void someTest(int key,string value)
{
var expectedkeyValuePairs = new KeyValuePair<int, string>(key, value);
// do some thing;
}