Ejemplo n.º 1
0
        public BuildDataFetcher(CruiseAddress cruiseAddress, IConfigSettings configSettings,
		                        IWebClientFactory webClientFactory)
        {
            _cruiseAddress = cruiseAddress;
            _webClientFactory = webClientFactory;
            _webClient = webClientFactory.GetWebClient(configSettings.URL);
            configSettings.AddObserver(this);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public void isvalid_true_if_url_valid()
 {
     var cruiseAddress = new CruiseAddress("http://valid");
     Assert.That(cruiseAddress.IsValid, Is.True);
 }
Ejemplo n.º 4
0
 public void isvalid_if_debug()
 {
     var cruiseAddress = new CruiseAddress("debug");
     Assert.That(cruiseAddress.IsValid, Is.True);
     Assert.That(cruiseAddress.IsDebug, Is.True);
 }
Ejemplo n.º 5
0
 public void isvalid_false_if_uri_emptystring()
 {
     var cruiseAddress = new CruiseAddress("");
     Assert.That(cruiseAddress.IsValid, Is.False);
 }
Ejemplo n.º 6
0
 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"));
 }
Ejemplo n.º 7
0
        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"));
        }
Ejemplo n.º 8
0
        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"));
        }
Ejemplo n.º 9
0
        public void can_append_filename_if_doesnt_exist()
        {
            var cruiseAddress = new CruiseAddress("http://mycruise/ccnet");

            Assert.That(cruiseAddress.Uri.ToString(), Text.EndsWith("/XmlStatusReport.aspx"));
        }
Ejemplo n.º 10
0
 public void SetUp()
 {
     _cruiseAddress = new CruiseAddress("http://valid/XmlStatusReport.aspx");
     _configSettings = new ConfigSettings { URL = _cruiseAddress.Url };
     _transformer = new BuildDataTransformer(_configSettings);
 }