I have a class which inherits from WebClient - in some code I am trying to test there is the usual:
using(var client = new SomeWebClient()){...}
Now I don't want to use that SomeWebClient
class in my tests so I'd like to inject in some kind of stub.
Without using the servicelocator pattern what are my options? I can't use any real IoC as this assembly is used by multiple platforms both mobile and full .NET
I'm sure the answer is staring me in the face but I think I'm having "one of those days"!
SomeWebClient
. Override all the functions there and use this in the test code (just exchange this one line which you have shown). Not perfect, but fulfills the requirements.