示例#1
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("验证此测试方法的正确性。");
 }
示例#2
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("验证此测试方法的正确性。");
 }