【发布时间】:2011-08-18 20:47:30
【问题描述】:
我正在使用 Visual Studio 2010 并创建了一堆单元测试。
这是一个例子:
[TestMethod()]
[HostType("ASP.NET")]
[AspNetDevelopmentServerHost("C:\\Users\\Employee\\Documents\\Code Spaces\\shopvote2\\trunk\\Web", "/Web")]
[UrlToTest("http://localhost/Web")]
public void GetUserDetailsTest()
{
api_Accessor target = new api_Accessor(); // TODO: Initialize to an appropriate value
string username = string.Empty; // TODO: Initialize to an appropriate value
string passhash = string.Empty; // TODO: Initialize to an appropriate value
int requestID = 0; // TODO: Initialize to an appropriate value
ShoppingRequestDetailsData[] expected = null; // TODO: Initialize to an appropriate value
ShoppingRequestDetailsData[] actual;
actual = target.GetUserDetails(username, passhash, requestID);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
问题是,它说:
找不到类型或命名空间名称“ShoppingRequestDetailsData”(您是否缺少 using 指令或程序集引用?)
无法将类型“ShoppingWithFriends.ShoppingRequestDetailsData[]”隐式转换为“ShoppingRequestDetailsData[]”
它会选择它来自的命名空间,我可以运行不需要自定义类的测试。只有这些给我带来了问题。
有什么想法吗?
谢谢。
【问题讨论】:
-
ShoppingRequestDetailsData公开吗? -
是的,该课程是公开的,我所有的课程都是公开的,我正在尝试访问
-
“您是否缺少 using 指令或程序集引用?”
标签: c# visual-studio visual-studio-2010 unit-testing testing