public void it_should_get_jobs_with_authentication() { var hudsonUrl = new HudsonUrl("http://classified.jenkins.baidu.com/view/DA-RANK/"); var hudsonApiGraber = new HudsonApiGraber(new CredentialSpider("zuoyulong", "123456")); var jobItems = hudsonApiGraber.GetJobs(new[] {hudsonUrl}); Assert.AreEqual(12, jobItems.Count()); }
public void it_should_get_jobs_without_authentication() { var hudsonUrl = new HudsonUrl("http://classified.jenkins.baidu.com/view/DA-RANK/"); var hudsonApiGraber = new HudsonApiGraber(new CommonSpider()); var jobItems = hudsonApiGraber.GetJobs(new[] {hudsonUrl}); Assert.AreEqual(2, jobItems.Count()); }
private void Logout() { loginButton.Text = "啊!我需要登录!!"; hudsonApiGraber = new HudsonApiGraber(new CommonSpider()); credendialMode = false; }
public void Refresh(IEnumerable<JobItem> items, HudsonApiGraber graber) { hudsonApiGraber = graber; ResetTimer(items); }
private void Login() { var userForm = new UserForm(); var dialogResult = userForm.ShowDialog(); if (dialogResult == DialogResult.OK) { var userName = userForm.userName.Text; var password = userForm.password.Text; var credentialSpider = new CredentialSpider(userName, password); hudsonApiGraber = new HudsonApiGraber(credentialSpider); loginButton.Text = string.Format("hi, 我是 {0}, {1}", userName, "点击注销!"); credendialMode = true; } }