我正在使用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'公众? –
是的,那个班级是公开的,所以我所有的班级都试图访问 – apexdodge
“你是否缺少使用指令或程序集引用?” – svick