I'm struggling to separate the dependencies in the following code:
public static SiteConnector ConnectToSite(String Logon, String Password)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(_URI);
ConfigureRequest(Logon, Password, webRequest);
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
Cookie ReposonseCookie;
//this looks for a cookie and spitsout a value based on response
int value = ProcessResponse(webResponse,out ReposonseCookie);
return new SiteConnector(ReposonseCookie, value);
}
Essentially I want to unit test without relying on the request to the external website.
What would be the best way of going about this?