C# 无法使用IntelliTest测试WCF终结点

C# 无法使用IntelliTest测试WCF终结点,c#,wcf,intellitest,C#,Wcf,Intellitest,我正在尝试使用IntelliTest测试我的WCF服务端点。我已经在测试项目中创建了IntelliTest单元,但是我需要指定服务器地址和端口,以便测试能够远程工作 这是pex方法之一 public ICredentials CredentialsTest() { ICredentials result = Service.Credentials(); return result; // TODO: add assertions to method ServiceTest

我正在尝试使用
IntelliTest
测试我的WCF服务端点。我已经在测试项目中创建了
IntelliTest
单元,但是我需要指定服务器地址和端口,以便测试能够远程工作

这是
pex方法之一

public ICredentials CredentialsTest()
{
    ICredentials result = Service.Credentials();
    return result;
    // TODO: add assertions to method ServiceTest.CredentialsTest()
}
我补充说

Service.ServiceEndPointAddress = "net.tcp://localhost:51010/WCFService";
但是当我运行测试时,我得到一个
invalidProgrameException


我想做的是分配ServiceEndPointAddress一次,因为它是服务中的静态属性。有谁能提供一些指导吗?

这里有几个问题:

  • 获取InvalidProgrameException表示IntelliTest以导致底层CLR引发异常的方式检测代码。这将是IntelliTest中的一个bug。我请求您使用VisualStudio中的“发送微笑”来提交此文件
  • 您不应该使用IntelliTest直接浏览WCF代码。相反,您应该使用mock隔离与WCF相关的外部依赖项(就像手工编写单元测试一样),然后运行IntelliTest来探索生成的代码。嘲笑你可以考虑使用假货。