我尝试使用IntelliTest
测试我的WCF服务端点我在测试项目中创建了IntelliTest
个单元,但我需要指定服务器地址和端口要求测试远程工作。
这是PexMethods
public ICredentials CredentialsTest()
{
ICredentials result = Service.Credentials();
return result;
// TODO: add assertions to method ServiceTest.CredentialsTest()
}
我已添加
Service.ServiceEndPointAddress = "net.tcp://localhost:51010/WCFService";
但是当我运行测试时,我得到InvalidProgramException
。
我想要做的是分配一次ServiceEndPointAddress,因为它是Service中的静态属性。有人可以提供一些指导吗?
答案 0 :(得分:0)
这里有几个问题: