我创建了一个WCF服务并试图测试其中一种方法。我右键单击WCF服务方法并选择创建单元测试。单元测试WCF方法
它创建了一个新的测试项目并创建了一个单元测试。
我试图运行测试项目,但我不知道UrlToTest
值应该是多少?我已经把网址的服务。
[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.");
}
谢谢你现在的工作,但我已经把一个破发点上的实际数量=目标.AuthenticateUser(authenticateRequest);它不会中断并让我调试wcf方法 – user228777
转到VS菜单中的Test,选择“Debug - > Test in Current Context”。还有在VS的测试工具工具栏中运行测试的选项。 –
我没有看到在调试菜单下的当前上下文中的测试选项,我是否需要进入选项进行设置?谢谢 – user228777