public void RegisterUserTest_8() { UserProfile UserProfileObj = new UserProfile(); UserProfileObj.SetFirstName(null); UserProfileObj.SetLastName("Demo_Test_LastName"); UserProfileObj.SetLastName("Demo_Test@Demo_Test.com"); UserProfileObj.SetHashedPassword("hashed_pwd"); UserProfileObj.SetSalt("salt"); UserProfileObj.SetToken("token"); UserProfileObj.SetRoleType(null); ExpectedOutput = "FAIL"; GotOutput = ""; try { NormalUserTemplate = new NormalUserTemplate(UserProfileObj); NormalUserTemplate.Add(); GotOutput = "SUCCESS"; } catch (Exception ex) { GotOutput = "FAIL"; } Assert.AreEqual(ExpectedOutput, GotOutput); }
public void RegisterUserTest_10() { UserProfile UserProfileObj = new UserProfile(); UserProfileObj.SetFirstName("Demo Name"); UserProfileObj.SetLastName("Demo_Test_LastName"); UserProfileObj.SetEmail("Demo_Test@Demo_Test.com"); UserProfileObj.SetHashedPassword("hashed_pwd"); UserProfileObj.SetSalt("salt"); UserProfileObj.SetToken("token"); UserProfileObj.SetRoleType("NORMAL"); UserProfileObj.SetPassword("aA!12345"); ExpectedOutput = "EMAIL ALREADY EXISTS"; try { NormalUserTemplate = new NormalUserTemplate(UserProfileObj); NormalUserTemplate.Add(); GotOutput = "SUCCESS"; } catch (MySqlException mse) { GotOutput = "EMAIL ALREADY EXISTS"; } catch (Exception ex) { GotOutput = "FAIL"; } Assert.AreEqual(ExpectedOutput, GotOutput); }
public void RegisterUserTest_6() { ExpectedOutput = "Invalid Arguments : Input parameters are null"; GotOutput = ""; UserProfile UserProfileObj = new UserProfile(); UserProfileObj.SetFirstName("Demo_FirstName"); UserProfileObj.SetLastName("Demo_Test_LastName"); UserProfileObj.SetLastName("Demo_Test@Demo_Test.com"); UserProfileObj.SetHashedPassword("hashed_pwd"); UserProfileObj.SetSalt("salt"); UserProfileObj.SetToken(null); ExpectedOutput = "FAIL"; GotOutput = ""; try { NormalUserTemplate = new NormalUserTemplate(UserProfileObj); NormalUserTemplate.Add(); GotOutput = "SUCCESS"; } catch (Exception ex) { GotOutput = "FAIL"; } Assert.AreEqual(ExpectedOutput, GotOutput); }
public void RegisterUserTest_1() { UserProfile UserProfileObj = new UserProfile(); UserProfileObj.SetFirstName(null); ExpectedOutput = "FAIL"; GotOutput = ""; try { NormalUserTemplate = new NormalUserTemplate(UserProfileObj); NormalUserTemplate.Add(); GotOutput = "SUCCESS"; } catch (Exception ex) { GotOutput = "FAIL"; } Assert.AreEqual(ExpectedOutput, GotOutput); }