public BuildDataFetcher(CruiseAddress cruiseAddress, IConfigSettings configSettings, IWebClientFactory webClientFactory) { _cruiseAddress = cruiseAddress; _webClientFactory = webClientFactory; _webClient = webClientFactory.GetWebClient(configSettings.URL); configSettings.AddObserver(this); }
public IWebClient GetWebClient(string url, string username, string password) { IWebClient webClient; var cruiseAddress = new CruiseAddress(url); if (cruiseAddress.IsDebug) { webClient = new SandboxWebClient(); } else { webClient = new HttpWebClient(username, password); } _log.InfoFormat("Using WebClient->[{0}]", webClient.GetType()); return webClient; }
public void isvalid_true_if_url_valid() { var cruiseAddress = new CruiseAddress("http://valid"); Assert.That(cruiseAddress.IsValid, Is.True); }
public void isvalid_if_debug() { var cruiseAddress = new CruiseAddress("debug"); Assert.That(cruiseAddress.IsValid, Is.True); Assert.That(cruiseAddress.IsDebug, Is.True); }
public void isvalid_false_if_uri_emptystring() { var cruiseAddress = new CruiseAddress(""); Assert.That(cruiseAddress.IsValid, Is.False); }
public void doesnot_prepend_http_if_already_exists() { var cruiseAddress = new CruiseAddress("http://mycruise/ccnet"); Assert.That(cruiseAddress.Uri.ToString(), Text.StartsWith("http://mycruise/ccnet")); }
public void doesnot_append_filename_if_already_exists_or_not_ccnet() { var cruiseAddress = new CruiseAddress("http://www.spice-3d.org/cruise/xml"); Assert.That(cruiseAddress.Uri.ToString(), Text.EndsWith("www.spice-3d.org/cruise/xml")); }
public void doesnot_append_filename_if_already_exists() { var cruiseAddress = new CruiseAddress("http://mycruise/ccnet/XmlStatusReport.aspx"); Assert.That(cruiseAddress.Uri.ToString(), Text.EndsWith("mycruise/ccnet/XmlStatusReport.aspx")); }
public void can_append_filename_if_doesnt_exist() { var cruiseAddress = new CruiseAddress("http://mycruise/ccnet"); Assert.That(cruiseAddress.Uri.ToString(), Text.EndsWith("/XmlStatusReport.aspx")); }
public void SetUp() { _cruiseAddress = new CruiseAddress("http://valid/XmlStatusReport.aspx"); _configSettings = new ConfigSettings { URL = _cruiseAddress.Url }; _transformer = new BuildDataTransformer(_configSettings); }