|
@ -106,4 +106,21 @@ public class CustomersTest extends TestCase { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |