示例#1
0
 public void LoginTest()
 {
     string staffNr = "leoni"; // TODO: 初始化为适当的值
         string pass = "******"; // TODO: 初始化为适当的值
         bool expected = true; // TODO: 初始化为适当的值
         ReturnMsg<LoginInfo> actual;
         IRestAuther auther = new RestAuther();
         actual = auther.Login(staffNr, pass);
         Assert.AreEqual(expected, actual.result);
         Console.WriteLine([email protected]);
         TestContext.WriteLine([email protected]);
 }
示例#2
0
 private void backWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         IRestAuther auther = new RestAuther();
         string[] args = e.Argument as string[];
         e.Result = auther.Login(args[0], args[1]);
     }
     catch (RestHostMissingException ex)
     {
         e.Result = new ReturnMsg<LoginInfo>() { result = false, content = ex.Message };
     }
 }