Currently I am working on an application which depends on a lot of external web services. A few of them are authorize.net and chargify.
When testing(manual testing) things other than the integration with these web services, I replace these web service dependencies with fake versions of them which don't really do anything. The way I am doing it as of now, is by using the following line of code in the structure map registry class:
For<IChargifyService>().Use<MockChargifyService>(); //uncomment this line to use a mock chargify service
I have similar lines in the registry for other fake services. I comment them out while deploying so that the real services are used in production. The real and fake service implementations are present in the Infrastructure
assembly.
The problem with this approach is that I have to remember to uncomment the lines before deploying. I know there is a way to do this using Structure Xml Config, But I was wondering if there is a better way to do this. Would creating a Mock Infrastructure
assembly be a good idea?