Beispiel #1
0
 public void GetUserNameByRankTest()
 {
     WebService target = new WebService(); // TODO: 初始化为适当的值
     int rank = 1; // TODO: 初始化为适当的值
     string expected = "bluebird"; // TODO: 初始化为适当的值
     string actual;
     actual = target.GetUserNameByRank(rank);
     Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("验证此测试方法的正确性。");
 }
Beispiel #2
0
 public void GetAcceptedTest()
 {
     WebService target = new WebService(); // TODO: 初始化为适当的值
     string name = "changchang"; // TODO: 初始化为适当的值
     ProgressBar progressBar = new ProgressBar(); // TODO: 初始化为适当的值
     List<Problem> expected = new List<Problem>(); // TODO: 初始化为适当的值
     List<Problem> actual;
     Problem problem = new Problem();
     problem.Id = 1003;
     problem.AcTime = Convert.ToDateTime("2012-10-26 00:34:36");
     expected.Add(problem);
     //progressBar.Value += 1;
     actual = target.GetAccepted(name, progressBar);
     Assert.AreEqual(expected[0].AcTime, actual[0].AcTime);
     Assert.AreEqual(expected[0].Id, actual[0].Id);
     //Assert.Inconclusive("验证此测试方法的正确性。");
 }
Beispiel #3
0
        private void submitbutton_Click(object sender, EventArgs e)
        {
            int language;
            String account, password, path, problemid, code;
            account = accounttextBox.Text;
            password = passwordtextBox.Text;
            path = codepathtextBox.Text;
            problemid = proIDtextBox.Text;
            language = languagecomboBox.SelectedIndex;
            code = getCode(path);

            Navigate(webBrowser1, "http://acm.hdu.edu.cn/showproblem.php?pid=" + problemid);

            WebService ws = new WebService();
            ws.loginAccount(account, password);
            ws.submitProblem(account, problemid, language.ToString(), code);
        }
Beispiel #4
0
 public void GetUserTest()
 {
     ProgressBar progressBar = new ProgressBar(); // TODO: 初始化为适当的值
     WebService target = new WebService(); // TODO: 初始化为适当的值
     string name = "edisond"; // TODO: 初始化为适当的值
     User expected = new User(); // TODO: 初始化为适当的值
     expected.Name = name;
     User actual;
     String url = "http://acm.hdu.edu.cn/userstatus.php?user="******"gb2312");
     String Page = target.GetWebContent(url, encode);
     expected.Accepted = System.Int32.Parse(Page.Substring(7567, 3));
     actual = target.GetUser(name, progressBar);
     Assert.AreEqual(expected.Accepted, actual.Accepted);
     //Assert.Inconclusive("验证此测试方法的正确性。");
 }
Beispiel #5
0
 public void WebServiceConstructorTest()
 {
     WebService target = new WebService();
     //Assert.Inconclusive("TODO: 实现用来验证目标的代码");
 }
Beispiel #6
0
 public void GetWebContentTest()
 {
     WebService target = new WebService(); // TODO: 初始化为适当的值
     string Url = "about:blank"; // TODO: 初始化为适当的值
     Encoding encode = Encoding.GetEncoding("gb2312"); // TODO: 初始化为适当的值
     string expected = null; // TODO: 初始化为适当的值
     string actual;
     actual = target.GetWebContent(Url, encode);
     Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("验证此测试方法的正确性。");
 }