// Case 6: // the new username doesn't exist and is valid // the new email is invalid @Test(expected = InvalidEmail_Exception.class) public void invalidEmail() throws Exception { SDIdImpl id = new SDIdImpl(); id.createUser(USERNAME, INVALID_EMAIL); }
// Case 5: // the new username doesn't exist and is null // the new email doesn't exist @Test(expected = InvalidUser_Exception.class) public void nullUsername() throws Exception { SDIdImpl id = new SDIdImpl(); id.createUser(NULL_USERNAME, EMAIL); }
// Case 3: // the new username doesn't exist and is valid // the new email already exists @Test(expected = EmailAlreadyExists_Exception.class) public void emailAlreadyExists() throws Exception { SDIdImpl id = new SDIdImpl(); id.createUser(USERNAME, EMAIL); id.createUser(USERNAME_2, EMAIL); }
// Case 1: // the new username doesn't exist and is valid // the new email doesn't exist @Test public void success() throws Exception { SDIdImpl id = new SDIdImpl(); id.createUser(USERNAME, EMAIL); UserAccount user = getUserAccountByUsername(id, USERNAME); assertNotNull("User was not created correctly.", user); assertEquals("Created user's Username is not correct.", user.getUserId(), USERNAME); assertEquals("Created user's Email is not correct.", user.getEmail(), EMAIL); }