2

Possible Duplicate:
Unit Testing a WCF Behavior Extension

I am new to unit testing. How do I write a unit test for a method when I am extending a WCF behavior. Since I am not sure of when the class is being instantiated, or I can not change the method signature. In the behavior implementation, I am getting the header and looking up a value in the config.

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)
    {
    }
}
Community
  • 1
  • 1
katie77
  • 1,797
  • 4
  • 25
  • 43

0 Answers0