|
|
@ -105,5 +105,22 @@ public class CustomersTest extends TestCase { |
|
|
|
assertEquals(userToRemove, removedUser.nickName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void test_registerAndCountUsers() { |
|
|
|
// Given |
|
|
|
Customers customers = new Customers(); |
|
|
|
int expectedRegisteredUsers = 20; |
|
|
|
int actualRegisteredUsers = -1; |
|
|
|
String nickname; |
|
|
|
|
|
|
|
// Prepare |
|
|
|
for(int i = 0, j = 1; i < expectedRegisteredUsers; i++, j++) { |
|
|
|
nickname = "beastMaster_" + j; |
|
|
|
customers.registerUser(new User(nickname)); |
|
|
|
} |
|
|
|
actualRegisteredUsers = customers.getCountOfUsers(); |
|
|
|
assertEquals(expectedRegisteredUsers, actualRegisteredUsers); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |