私は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