Open JhonnyLi opened 5 years ago
Tried adding a protected method to ProxyHttpClientConfig that I can test by using:
PrivateObject obj = new PrivateObject(target);
var retVal = obj.Invoke("CreateUriFromUrl",Mockup.MockUrl);
Still seems like an invalid way of doing this since the constructor will throw and exception if the url is invalid.
After introducing Unit tests I have come to the conclusion that creating a Uri in the constructor is bad conduct. Too many things can go wrong and its hard/impossible to test in a satisfactory fashion.
It needs to be changed in a way that still makes it simple to use and test.