public void TestCNLogin() { string user = TestContext.DataRow[0].ToString(); string pass = TestContext.DataRow[1].ToString(); bool expected = bool.Parse(TestContext.DataRow[2].ToString()); FDangNhap f = new FDangNhap(); f.txtTen = user; f.txtpass = pass; bool actual = f.isAccepted(); Assert.AreEqual(expected, actual); }
public void TestCNLogin() { string userName = TestContext.DataRow[0].ToString(); string passWord = TestContext.DataRow[1].ToString(); bool expected = bool.Parse(TestContext.DataRow[2].ToString()); if (userName.Length > 100 || passWord.Length > 100) { throw new InvalidOperationException("số kí tự quá lớn"); } else { FDangNhap b = new FDangNhap(); b.userName = userName; b.passWord = passWord; bool actual = b.isAccepted(); Assert.AreEqual(expected, actual); } }