From 59ba7db3a512154716b96d05cc98ae704fa16de3 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 04:46:15 +0100 Subject: [PATCH] Added: Nickname allready taken test --- .../de/hs_fulda/ciip/projjpn/CustomersTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java index e89d5e2..2816fc5 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java @@ -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();