public void TestMethod1() { //Arrange string BeginName = "test"; string BeginName1 = "test123"; string BeginPWD = "6789"; string Test_PWD_Correct = "9999"; string Test_PWD_Wrong = "6666"; int BeginLev = 55688; //Act //Conn_sql.Add_member(BeginName, BeginPWD, BeginLev); //Conn_sql.Change_pwd(BeginName, "9999"); //Assert string Ans; Ans = Conn_sql.Get_data(BeginName1); if (Ans == Test_PWD_Correct) { Console.WriteLine("Correct!!"); } else { Console.WriteLine("Wrong!!!!!!!!!!!!!!!"); } }
public static void Main(string[] args) { //Arrange string BeginName = "test"; string BeginName1 = "test123"; string BeginPWD = "6789"; string Test_PWD_Correct = "9999"; int BeginLev = 55688; //Act Conn_sql.Add_member(BeginName, BeginPWD, BeginLev); Conn_sql.Change_pwd(BeginName, "9999"); //Assert string Ans; Ans = Conn_sql.Get_data(BeginName); if (Ans == Test_PWD_Correct) { Console.WriteLine("Correct!!"); } else { Console.WriteLine("Wrong!!!!!!!!!!!!!!!"); } Conn_sql.del_member(BeginName); }
public void Test_Success() { //Arrange string BeginName = "test"; string BeginName1 = "test123"; string BeginPWD = "6789"; string Test_PWD_Correct = "9999"; string Test_PWD_Wrong = "6666"; int BeginLev = 55688; //Act Conn_sql.del_member(BeginName); Conn_sql.Add_member(BeginName, BeginPWD, BeginLev); Conn_sql.Change_pwd(BeginName, "9999"); //Assert string ans; ans = Conn_sql.Get_data(BeginName); Assert.AreEqual(Test_PWD_Correct, ans); //string Ans; //Ans = Conn_sql.Get_data(BeginName1); //if (Ans == Test_PWD_Correct) //{ // Console.WriteLine("Correct!!"); //} //else //{ // Console.WriteLine("Wrong!!!!!!!!!!!!!!!"); //} }