I am testing a web service client and need to isolate the call to the web service.
I have already been told that we can not use dependency injection. How can I isolate the webservice so that I can test the business logic that calls that service. Since I can not control the webservice I need to be sure of the value that the service will return.
I have been told that using Microsoft Fakes I can do this, but do not know how to define the fake.
A simplified version of the code that I am testing is:
var client = new Serviceprovider.ServiceProxies.PromoService.PromoServiceClient();
client.ClientCredentials.Windows.AllowedImpersonationLevel = client.Open();
Promo promoFromMaps = client.GetPromoById(exitingPm.NetworkId, true, true, true, exitingPm.MapsPromoId);
I want to control the values stored in promoFromMaps to be able to test the business logic that occurs after that.
Thanks for your time.