예제 #1
0
        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;
        }
예제 #3
0
 public void isvalid_true_if_url_valid()
 {
     var cruiseAddress = new CruiseAddress("http://valid");
     Assert.That(cruiseAddress.IsValid, Is.True);
 }
예제 #4
0
 public void isvalid_if_debug()
 {
     var cruiseAddress = new CruiseAddress("debug");
     Assert.That(cruiseAddress.IsValid, Is.True);
     Assert.That(cruiseAddress.IsDebug, Is.True);
 }
예제 #5
0
 public void isvalid_false_if_uri_emptystring()
 {
     var cruiseAddress = new CruiseAddress("");
     Assert.That(cruiseAddress.IsValid, Is.False);
 }
예제 #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"));
 }
예제 #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"));
        }
예제 #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"));
        }
예제 #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"));
        }
 public void SetUp()
 {
     _cruiseAddress = new CruiseAddress("http://valid/XmlStatusReport.aspx");
     _configSettings = new ConfigSettings { URL = _cruiseAddress.Url };
     _transformer = new BuildDataTransformer(_configSettings);
 }