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); }
public void RegisterUserTest_4() { 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(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_11() { 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("NORMAL"); ExpectedOutput = "NOT REGISTERED"; try { NormalUserTemplate = new NormalUserTemplate(UserProfileObj); NormalUserTemplate.Add(); GotOutput = "SUCCESS"; } catch (Exception ex) { GotOutput = "NOT REGISTERED"; } Assert.AreEqual(ExpectedOutput, GotOutput); }