我对 ac# 测试方法有疑问。
看起来像:
public void GetRolesTest()
{
RoleProvider target = new RoleProvider();
string username = "FOO";
string[] expected = new string[2];
expected[0] = "Admin";
expected[1] = "User";
string[] actual;
actual = target.GetRoles(username);
Assert.AreEqual<string[]>(expected, actual);
}
被测试的方法只是做以下事情:
public override string[] GetRoles(string username)
{
string[] output = new string[2];
output[0] = "Admin";
output[1] = "User";
return output;
}
运行测试后,我收到以下错误:
Error in "Assert.AreEqual". Expected:<System.String[]>. Acutally:<System.String[]>.
有人能告诉我那里有什么问题吗?