Can anyone advise on how to go about Mocking the 'RequestContext' in a WCF service.
I'm currently working on a legacy WCF service that relies heavily upon headers being set in the request context.
Below I have a factory that I'd like to test, but I'm struggling mocking out the request context.
public IMerchantProvider GetProvider(RequestContext requestContext)
{
var mobileRequest = _mobileRequestGenerator.GenerateMobileRequest(requestContext);
if (UseMerchantService)
{
return new MerchantServiceProvider(new MobileObjectsMapper(Mapper.Instance), mobileRequest); //IOC This New, guys.
}
return new DataServiceMerchantProvider(mobileRequest, _merchantProgramListHelper, _merchantOfferHelper);
}
Note: I am using Moq to mock out the other dependencies.
Thanks,