|
@ -88,4 +88,22 @@ public class CustomersTest extends TestCase { |
|
|
assertTrue(userRegistered); |
|
|
assertTrue(userRegistered); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void test_removeRegisteredUser() { |
|
|
|
|
|
// Given |
|
|
|
|
|
Customers customers = new Customers(); |
|
|
|
|
|
String userToRemove = "beastMaster64"; |
|
|
|
|
|
User userToRegister = new User("beastMaster64"); |
|
|
|
|
|
customers.registerUser(userToRegister); |
|
|
|
|
|
|
|
|
|
|
|
// When |
|
|
|
|
|
boolean userExists = !customers.nickNameAvailable(userToRemove); |
|
|
|
|
|
assertTrue(userExists); |
|
|
|
|
|
|
|
|
|
|
|
// Then |
|
|
|
|
|
User removedUser = customers.deleteUser(userToRemove); |
|
|
|
|
|
assertEquals(userToRemove, removedUser.nickName); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |