【发布时间】:2011-10-28 13:24:40
【问题描述】:
我创建了 WCF 服务并尝试测试其中一种方法。我右键单击 WCF 服务方法并选择创建单元测试。
它创建了一个新的测试项目并创建了一个单元测试。
我尝试运行测试项目,但我不确定UrlToTest 的值应该是多少?我已将 url 放入服务中。
[TestMethod()]
[HostType("ASP.NET")]
[AspNetDevelopmentServerHost("C:\\VS Projects\\NetBranch4\\" +
"MobileCheckCapture\\MobileCheckCapture", "/")]
// [UrlToTest("http://localhost:45651/")]
[UrlToTest("http://localhost/mobilecc/mobilecc.svc")]
public void AuthenticateUserTest()
{
// TODO: Initialize to an appropriate value
MobileCC target = new MobileCC();
// TODO: Initialize to an appropriate value
string authenticateRequest = string.Empty;
// TODO: Initialize to an appropriate value
string expected = string.Empty;
string actual;
actual = target.AuthenticateUser(authenticateRequest);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
【问题讨论】:
标签: .net wcf unit-testing