@Test
  public void testRegisterUserValidEmailFaultyDatabase() {
    RegistrationPack registrationPack = new RegistrationPack();
    registrationPack.setEmailAddress(validEmail);

    dbStub.setEmailRegistered(false);
    assertFalse(test.registerUser(registrationPack));
  }
  @Test
  public void testRegisterUserValidEmail() {
    RegistrationPack registrationPack = new RegistrationPack();
    registrationPack.setEmailAddress(validEmail);

    dbStub.setEmailRegistered(true);
    assertTrue(test.registerUser(registrationPack));
  }
  @Test
  public void testChangeEmailAddressValidEmailFaultyDatabase() {
    RegistrationPack registrationPack = new RegistrationPack();
    registrationPack.setEmailAddress(validEmail);
    dbStub.setEmailChanged(false);

    assertFalse(test.changeEmailAddress(registrationPack));
  }
  @Test
  public void testChangeEmailAddressValidEmail() {
    RegistrationPack registrationPack = new RegistrationPack();
    registrationPack.setEmailAddress(validEmail);
    dbStub.setEmailChanged(true);

    assertTrue(test.changeEmailAddress(registrationPack));
  }
 @Test
 public void testRegisterUserInvalidEmail() {
   RegistrationPack registrationPack = new RegistrationPack();
   registrationPack.setEmailAddress(invalidEmail);
   assertFalse(test.registerUser(registrationPack));
 }
 @Test
 public void testChangeEmailAddressInvalidEmail() {
   RegistrationPack registrationPack = new RegistrationPack();
   registrationPack.setEmailAddress(invalidEmail);
   assertFalse(test.changeEmailAddress(registrationPack));
 }