Browse Source

Added: Nickname allready taken test

feature-pr/user
Maxim Volkov 3 years ago
parent
commit
59ba7db3a5
  1. 16
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java

16
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java

@ -16,6 +16,22 @@ public class CustomersTest extends TestCase {
assertTrue(nicknameIsAvailable); 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() { public void test_registerSingleUser() {
// Given // Given
Customers customers = new Customers(); Customers customers = new Customers();

Loading…
Cancel
Save