|
|
@ -16,6 +16,22 @@ public class CustomersTest extends TestCase { |
|
|
|
assertTrue(nicknameIsAvailable); |
|
|
|
} |
|
|
|
|
|
|
|
public void test_nicknameIsTaken() { |
|
|
|
// Given |
|
|
|
Customers customers = new Customers(); |
|
|
|
String availableNickname = "beastMaster64"; |
|
|
|
String takenNickname = "beastMaster64"; |
|
|
|
User userToRegister = new User(availableNickname); |
|
|
|
|
|
|
|
customers.registerUser(userToRegister); |
|
|
|
|
|
|
|
// When |
|
|
|
boolean nicknameIsTaken = !customers.nickNameAvailable(availableNickname); |
|
|
|
|
|
|
|
// Then |
|
|
|
assertTrue(nicknameIsTaken); |
|
|
|
} |
|
|
|
|
|
|
|
public void test_registerSingleUser() { |
|
|
|
// Given |
|
|
|
Customers customers = new Customers(); |
|
|
|