如何为WCF行为编写单元测试?

时间:2012-07-03 03:12:25

标签: wcf unit-testing

  

可能重复:
  Unit Testing a WCF Behavior Extension

我是单元测试的新手。 在扩展WCF行为时,如何为方法编写单元测试。由于我不确定何时实例化类,或者我无法更改方法签名。在行为实现中,我得到标题并在配置中查找值。

public class IncomingValidator : IDispatchMessageInspector
{

    public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
    {
            // Grab the header and see if one of the particular values(read from config) is there. 
    }

    public void BeforeSendReply(ref Message reply, object correlationState)
    {
    }
}

0 个答案:

没有答案
相关问题