From 866ff0de7dcc3b1c315f9ebc0233b0e674e8ebcd Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 16:23:19 +0100 Subject: [PATCH 01/36] Added: Item class + Basic InStock Test --- .../main/java/de/hs_fulda/ciip/projjpn/Item.java | 15 +++++++++++++++ .../java/de/hs_fulda/ciip/projjpn/ItemTest.java | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java create mode 100644 projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java new file mode 100644 index 0000000..8b6cc9f --- /dev/null +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -0,0 +1,15 @@ +package de.hs_fulda.ciip.projjpn; + +public class Item { + + // price + // customerReview + // productTitle + // description + // tags + int availability = 0; + + public boolean inStock() { + return availability > 0; + } +} diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java new file mode 100644 index 0000000..c6467ba --- /dev/null +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -0,0 +1,16 @@ +package de.hs_fulda.ciip.projjpn; + +import junit.framework.TestCase; + +public class ItemTest extends TestCase { + public void test_ItemNotInStock() { + // Given + Item item = new Item(); + + // When + boolean notInStock = item.inStock(); + + // Then + assertFalse(notInStock); + } +} From 343f408977e991278adb2a957acc63e68a94e42c Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 16:28:54 +0100 Subject: [PATCH 02/36] Added: Update Availability Test --- .../src/main/java/de/hs_fulda/ciip/projjpn/Item.java | 4 ++++ .../test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index 8b6cc9f..44fc02d 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -12,4 +12,8 @@ public class Item { public boolean inStock() { return availability > 0; } + + public void updateAvailability(int newAmount) { + availability = newAmount; + } } diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index c6467ba..1ba1359 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -13,4 +13,15 @@ public class ItemTest extends TestCase { // Then assertFalse(notInStock); } + + public void test_ItemInStock() { + // Given + Item item = new Item(); + item.updateAvailability(1); + // When + boolean inStock = item.inStock(); + + // Then + assertTrue(inStock); + } } From b772bac368e3f347cfc165d5eb901ac1afb158ac Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 16:45:08 +0100 Subject: [PATCH 03/36] Added: Price Of Multiple Identical Items Test --- .../java/de/hs_fulda/ciip/projjpn/Item.java | 12 +++++++++-- .../de/hs_fulda/ciip/projjpn/ItemTest.java | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index 44fc02d..c92998d 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -2,12 +2,12 @@ package de.hs_fulda.ciip.projjpn; public class Item { - // price + private int price; // customerReview // productTitle // description // tags - int availability = 0; + private int availability = 0; public boolean inStock() { return availability > 0; @@ -16,4 +16,12 @@ public class Item { public void updateAvailability(int newAmount) { availability = newAmount; } + + public void updatePrice(int price) { + this.price = price; + } + + public int getCurrentPrice() { + return price; + } } diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 1ba1359..d06afe2 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -24,4 +24,25 @@ public class ItemTest extends TestCase { // Then assertTrue(inStock); } + + public void test_priceOfMultipleIdenticalItems() { + // Given + Item item = new Item(); + int quantity = 3; + int price = 5; + item.updateAvailability(quantity); + item.updatePrice(price); + + // When + int expectedPrice = quantity * price; + + // Then + int actualPrice = 0; + for(int i = 0; i < quantity; i++) { + actualPrice += item.getCurrentPrice(); + } + + + assertEquals(expectedPrice, actualPrice); + } } From f6511309b118cb72abed38214eb52d4865a5ee19 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 16:55:28 +0100 Subject: [PATCH 04/36] Optimizing: Price of Item is float now --- projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java | 6 +++--- .../src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index c92998d..3311467 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -2,7 +2,7 @@ package de.hs_fulda.ciip.projjpn; public class Item { - private int price; + private float price; // customerReview // productTitle // description @@ -17,11 +17,11 @@ public class Item { availability = newAmount; } - public void updatePrice(int price) { + public void updatePrice(float price) { this.price = price; } - public int getCurrentPrice() { + public float getCurrentPrice() { return price; } } diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index d06afe2..cc367c9 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -29,20 +29,19 @@ public class ItemTest extends TestCase { // Given Item item = new Item(); int quantity = 3; - int price = 5; + float price = 5; item.updateAvailability(quantity); item.updatePrice(price); // When - int expectedPrice = quantity * price; + float expectedPrice = quantity * price; // Then - int actualPrice = 0; + float actualPrice = 0; for(int i = 0; i < quantity; i++) { actualPrice += item.getCurrentPrice(); } - assertEquals(expectedPrice, actualPrice); } } From 53b792fcc559c1cd9357d55d6f076cb9fd9a0fae Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 17:15:10 +0100 Subject: [PATCH 05/36] Added: Build Complete Item Basic Test --- .../java/de/hs_fulda/ciip/projjpn/Item.java | 23 ++++++++++++++----- .../de/hs_fulda/ciip/projjpn/ItemTest.java | 7 ++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index 3311467..d9828ef 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -1,13 +1,24 @@ package de.hs_fulda.ciip.projjpn; public class Item { - - private float price; - // customerReview - // productTitle - // description - // tags + // @ToDo: customerReview + private String productTitle; + private String description; private int availability = 0; + private float price; + + public Item() { + } + + public Item(String titel, + String description, + int quantity, + float price) { + this.productTitle = titel; + this.description = description; + this.availability = quantity; + this.price = price; + } public boolean inStock() { return availability > 0; diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index cc367c9..6abf9c3 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -44,4 +44,11 @@ public class ItemTest extends TestCase { assertEquals(expectedPrice, actualPrice); } + + public void test_buildCompleteItem() { + // Given + Item item = new Item("Logitec Maus", "Gaming Maus fuer Fortgeschrittene.", 10, 69.99f); + + assertNotNull(item); + } } From b9c6c11abf9176fa5a28ade0a3334f594812b71e Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 17:18:31 +0100 Subject: [PATCH 06/36] Minor Refactoring of test_buildCompleteItem() --- .../src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 6abf9c3..2a94571 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -47,7 +47,11 @@ public class ItemTest extends TestCase { public void test_buildCompleteItem() { // Given - Item item = new Item("Logitec Maus", "Gaming Maus fuer Fortgeschrittene.", 10, 69.99f); + String expectedTitel = "Logitec Maus"; + String expectedDescription = "Gaming Maus fuer Fortgeschrittene."; + int expectedQuantity = 10; + float expectedPrice = 69.99f; + Item item = new Item(expectedTitel, expectedDescription, expectedQuantity, expectedPrice); assertNotNull(item); } From a3b16658752ed0af17132f5ea8e453e775f9ad28 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 17:28:11 +0100 Subject: [PATCH 07/36] Extended: test_buildCompleteItem() by validDescription Test --- .../src/main/java/de/hs_fulda/ciip/projjpn/Item.java | 12 ++++++++++++ .../test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 11 +++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index d9828ef..6b9c5f1 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -24,6 +24,10 @@ public class Item { return availability > 0; } + public float getCurrentStock() { + return availability; + } + public void updateAvailability(int newAmount) { availability = newAmount; } @@ -35,4 +39,12 @@ public class Item { public float getCurrentPrice() { return price; } + + public String getTitel() { + return this.productTitle; + } + + public String getDescription() { + return this.description; + } } diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 2a94571..6b2f0b2 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -51,8 +51,15 @@ public class ItemTest extends TestCase { String expectedDescription = "Gaming Maus fuer Fortgeschrittene."; int expectedQuantity = 10; float expectedPrice = 69.99f; - Item item = new Item(expectedTitel, expectedDescription, expectedQuantity, expectedPrice); - assertNotNull(item); + // When + Item itemNotNull = new Item(expectedTitel, expectedDescription, expectedQuantity, expectedPrice); + + // Then + assertNotNull(itemNotNull); + + // When + boolean validDescription = itemNotNull.getDescription().equals(expectedDescription); + assertTrue(validDescription); } } From de0afe0f23debda6379add3dc2e6c27d4e02dc56 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 17:28:51 +0100 Subject: [PATCH 08/36] Extended: test_buildCompleteItem() by validTitle Test --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 6b2f0b2..6583144 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -61,5 +61,8 @@ public class ItemTest extends TestCase { // When boolean validDescription = itemNotNull.getDescription().equals(expectedDescription); assertTrue(validDescription); + + boolean validTitle = itemNotNull.getTitel().equals(expectedTitel); + assertTrue(validTitle); } } From a7fdc436a92cc37c8621c25899dac79ff5478370 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 17:29:30 +0100 Subject: [PATCH 09/36] Extended: test_buildCompleteItem() by validQuantity Test --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 6583144..307b192 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -64,5 +64,8 @@ public class ItemTest extends TestCase { boolean validTitle = itemNotNull.getTitel().equals(expectedTitel); assertTrue(validTitle); + + boolean validQuantity = itemNotNull.getCurrentStock() == expectedQuantity; + assertTrue(validQuantity); } } From 235e72665a1e65f4e7b7b60792ff9329a17e524f Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 17:30:39 +0100 Subject: [PATCH 10/36] Extended: test_buildCompleteItem() by validPrice Test --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 307b192..4a5dcc4 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -67,5 +67,8 @@ public class ItemTest extends TestCase { boolean validQuantity = itemNotNull.getCurrentStock() == expectedQuantity; assertTrue(validQuantity); + + boolean validPrice = itemNotNull.getCurrentPrice() == expectedPrice; + assertTrue(validPrice); } } From 90025123e994319eeede498e5e092a249bf93ce3 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 21:48:07 +0100 Subject: [PATCH 11/36] Added: Insert Item into Warehouse + Basic Test --- .../de/hs_fulda/ciip/projjpn/Warehouse.java | 15 +++++++++ .../hs_fulda/ciip/projjpn/WarehouseTest.java | 31 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java create mode 100644 projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java new file mode 100644 index 0000000..3a13f09 --- /dev/null +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java @@ -0,0 +1,15 @@ +package de.hs_fulda.ciip.projjpn; + +import java.util.HashMap; + +public class Warehouse { + protected HashMap pool = new HashMap(); + + + + + public Item insertItem(Item item) { + return pool.putIfAbsent(item.getTitel(), item); + } + +} \ No newline at end of file diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java new file mode 100644 index 0000000..ef10f59 --- /dev/null +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java @@ -0,0 +1,31 @@ +package de.hs_fulda.ciip.projjpn; + +import junit.framework.TestCase; + +public class WarehouseTest extends TestCase { + /* + * public void test_fillWareHouseWithItems() { for (int i = 0; i < 10; i++) { + * + * } } + */ + + public void test_insertItemInWarehouse() { + // Given + Warehouse warehouse = new Warehouse(); + + String expectedTitel = "Logitec Maus"; + String expectedDescription = "Gaming Maus fuer Fortgeschrittene."; + int expectedQuantity = 10; + float expectedPrice = 69.69f; + + // When + Item expectedItem = new Item(expectedTitel, expectedDescription, expectedQuantity, expectedPrice); + assertNotNull(expectedItem); + warehouse.insertItem(expectedItem); + + Item gotItem = warehouse.pool.get(expectedTitel); + + // Then + assertEquals(expectedTitel, gotItem.getTitel()); + } +} From 681a7a7f59450663178513c016bef93a3a63b373 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:08:36 +0100 Subject: [PATCH 12/36] Added: Get Count Of Stock + Basic Test --- .../de/hs_fulda/ciip/projjpn/Warehouse.java | 10 +++++++--- .../hs_fulda/ciip/projjpn/WarehouseTest.java | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java index 3a13f09..6b6a867 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java @@ -4,12 +4,16 @@ import java.util.HashMap; public class Warehouse { protected HashMap pool = new HashMap(); - - - public Item insertItem(Item item) { return pool.putIfAbsent(item.getTitel(), item); } + public int getCountOfStock() { + int sumItems = 0; + for (HashMap.Entry set : pool.entrySet()) { + sumItems += set.getValue().getCurrentStock(); + } + return sumItems; + } } \ No newline at end of file diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java index ef10f59..f713f83 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java @@ -28,4 +28,22 @@ public class WarehouseTest extends TestCase { // Then assertEquals(expectedTitel, gotItem.getTitel()); } + + + public void test_growingCountOfItemsInWarehouse() { + // Given + Warehouse warehouse = new Warehouse(); + int unitsPerItemType = 3; + int expectedSize = 13; + for(int i = 0; i < expectedSize; i++) { + Item item = new Item("ItemDummy" + i, "DescriptionDummy" + i, unitsPerItemType, 12.0f); + warehouse.insertItem(item); + } + int expectedSum = expectedSize * unitsPerItemType; + int actualSumOfAllItems = warehouse.getCountOfStock(); + + // Then + assertEquals(expectedSum, actualSumOfAllItems); + + } } From b6d9a7d4497e9cb71bda1edcdb444f4b3b1a82dd Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:10:28 +0100 Subject: [PATCH 13/36] Added: Empty Warehouse Test --- .../java/de/hs_fulda/ciip/projjpn/WarehouseTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java index f713f83..74fb8f9 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java @@ -44,6 +44,18 @@ public class WarehouseTest extends TestCase { // Then assertEquals(expectedSum, actualSumOfAllItems); + } + + public void test_emptyWarehouse() { + // Given + Warehouse warehouse = new Warehouse(); + + // When + int expectedSum = 0; + + // Then + int actualSumOfAllItems = warehouse.getCountOfStock(); + assertEquals(expectedSum, actualSumOfAllItems); } } From e1615c8adf914112e6312cd5105f2d665c92ebc0 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:11:50 +0100 Subject: [PATCH 14/36] Added: Javadoc for test_emptyWarehouse() --- .../src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java index 74fb8f9..2c388f8 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java @@ -46,6 +46,9 @@ public class WarehouseTest extends TestCase { assertEquals(expectedSum, actualSumOfAllItems); } + /** + * Empty Warehouse means there are a total of zero Items. + */ public void test_emptyWarehouse() { // Given Warehouse warehouse = new Warehouse(); From 5667effc02607b81e9aa5ed5c4607791711b6e8b Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:13:22 +0100 Subject: [PATCH 15/36] Added: Javadoc for test_growingCountOfItemsInWarehouse --- .../src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java index 2c388f8..e053308 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java @@ -29,7 +29,9 @@ public class WarehouseTest extends TestCase { assertEquals(expectedTitel, gotItem.getTitel()); } - + /** + * Test the total Sum of Items in the whole Warehouse. + */ public void test_growingCountOfItemsInWarehouse() { // Given Warehouse warehouse = new Warehouse(); From 2b8a628c60c22775022bea1be31bc2fc55b8ac0c Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:15:58 +0100 Subject: [PATCH 16/36] Added: Javadoc for test_insertItemInWarehouse() --- .../hs_fulda/ciip/projjpn/WarehouseTest.java | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java index e053308..5b7234e 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/WarehouseTest.java @@ -3,12 +3,9 @@ package de.hs_fulda.ciip.projjpn; import junit.framework.TestCase; public class WarehouseTest extends TestCase { - /* - * public void test_fillWareHouseWithItems() { for (int i = 0; i < 10; i++) { - * - * } } + /** + * Check if the insertion of an Item works properly. */ - public void test_insertItemInWarehouse() { // Given Warehouse warehouse = new Warehouse(); @@ -22,42 +19,42 @@ public class WarehouseTest extends TestCase { Item expectedItem = new Item(expectedTitel, expectedDescription, expectedQuantity, expectedPrice); assertNotNull(expectedItem); warehouse.insertItem(expectedItem); - + Item gotItem = warehouse.pool.get(expectedTitel); - + // Then assertEquals(expectedTitel, gotItem.getTitel()); } - + /** - * Test the total Sum of Items in the whole Warehouse. + * Test the total Sum of Items in the whole Warehouse. */ public void test_growingCountOfItemsInWarehouse() { // Given Warehouse warehouse = new Warehouse(); int unitsPerItemType = 3; int expectedSize = 13; - for(int i = 0; i < expectedSize; i++) { + for (int i = 0; i < expectedSize; i++) { Item item = new Item("ItemDummy" + i, "DescriptionDummy" + i, unitsPerItemType, 12.0f); warehouse.insertItem(item); } int expectedSum = expectedSize * unitsPerItemType; int actualSumOfAllItems = warehouse.getCountOfStock(); - + // Then assertEquals(expectedSum, actualSumOfAllItems); } - + /** * Empty Warehouse means there are a total of zero Items. */ - public void test_emptyWarehouse() { + public void test_emptyWarehouse() { // Given Warehouse warehouse = new Warehouse(); - + // When int expectedSum = 0; - + // Then int actualSumOfAllItems = warehouse.getCountOfStock(); assertEquals(expectedSum, actualSumOfAllItems); From 22f136449f0d007c8c58d8a8ceb5c6d1dd5fd5d1 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:17:56 +0100 Subject: [PATCH 17/36] Added: Javadoc for Warehouse --- .../main/java/de/hs_fulda/ciip/projjpn/Warehouse.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java index 6b6a867..c0fd4fa 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Warehouse.java @@ -5,10 +5,19 @@ import java.util.HashMap; public class Warehouse { protected HashMap pool = new HashMap(); + /** + * + * @param item Item to insert. + * @return the inserted Item or null. + */ public Item insertItem(Item item) { return pool.putIfAbsent(item.getTitel(), item); } + /** + * + * @return The total amount of all Items. + */ public int getCountOfStock() { int sumItems = 0; for (HashMap.Entry set : pool.entrySet()) { From 28035c530f320d3db5f882e47a0c0c0f840812f5 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:19:39 +0100 Subject: [PATCH 18/36] Added: Javadoc for Item constructors --- .../main/java/de/hs_fulda/ciip/projjpn/Item.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index 6b9c5f1..b1ccc9f 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -1,15 +1,25 @@ package de.hs_fulda.ciip.projjpn; public class Item { - // @ToDo: customerReview + private String productTitle; private String description; private int availability = 0; private float price; + /** + * Creation of blank Item. + */ public Item() { } + /** + * Creation of Item. + * @param titel + * @param description + * @param quantity + * @param price + */ public Item(String titel, String description, int quantity, @@ -32,6 +42,7 @@ public class Item { availability = newAmount; } + public void updatePrice(float price) { this.price = price; } From 2b32772c85c3f0745ac29e8f6005036831cf4837 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:21:27 +0100 Subject: [PATCH 19/36] Added: Javadoc for Item Methods --- projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index b1ccc9f..b9ac69e 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -30,10 +30,18 @@ public class Item { this.price = price; } + /** + * + * @return true if at least one item is in stock. + */ public boolean inStock() { return availability > 0; } + /** + * + * @return current number of this items + */ public float getCurrentStock() { return availability; } From 70fa1700f510ab13590f9e301baad25e5f1b7105 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:23:52 +0100 Subject: [PATCH 20/36] Added: Javadoc for Item Methods + minor refactoring --- .../main/java/de/hs_fulda/ciip/projjpn/Item.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index b9ac69e..4f51d78 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -46,13 +46,20 @@ public class Item { return availability; } + /** + * + * @param newAmount of items + */ public void updateAvailability(int newAmount) { availability = newAmount; } - - public void updatePrice(float price) { - this.price = price; + /** + * + * @param newPrice of this item. + */ + public void updatePrice(float newPrice) { + this.price = newPrice; } public float getCurrentPrice() { From b48c04fc39892770f12ff0752d6c9606368d5e92 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:28:00 +0100 Subject: [PATCH 21/36] Added: Javadoc for Item class --- .../src/main/java/de/hs_fulda/ciip/projjpn/Item.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java index 4f51d78..1be3965 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Item.java @@ -62,14 +62,26 @@ public class Item { this.price = newPrice; } + /** + * + * @return Current Price of the Item. + */ public float getCurrentPrice() { return price; } + /** + * + * @return Current public Title of this Item. + */ public String getTitel() { return this.productTitle; } + /** + * + * @return Current public Description of this Item. + */ public String getDescription() { return this.description; } From 906bd9e4c99440b78eae37747576772e92f3fac7 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:28:59 +0100 Subject: [PATCH 22/36] Added: Javadoc for Customers registerUser() --- .../src/main/java/de/hs_fulda/ciip/projjpn/Customers.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java index 174016e..4db7278 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java @@ -13,6 +13,11 @@ public class Customers { return false; } + /** + * + * @param user New User to register. + * @return + */ public User registerUser(User user) { return pool.putIfAbsent(user.nickName, user); } From a62245ae49c9d8e3796cd7ccfc2fa7360422d9d1 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:29:46 +0100 Subject: [PATCH 23/36] Added: Javadoc for Customers deleteUser() --- .../src/main/java/de/hs_fulda/ciip/projjpn/Customers.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java index 4db7278..98fb54a 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java @@ -22,6 +22,11 @@ public class Customers { return pool.putIfAbsent(user.nickName, user); } + /** + * + * @param userNickname Delete a particular User with the given nickname + * @return null or the deleted user. + */ public User deleteUser(String userNickname) { return pool.remove(userNickname); } From bfb15c62bed3741196d3ad422bbb201b9b38ed8f Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:30:38 +0100 Subject: [PATCH 24/36] Added: Javadoc for Customers getByNickname() --- .../src/main/java/de/hs_fulda/ciip/projjpn/Customers.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java index 98fb54a..a381188 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java @@ -31,6 +31,11 @@ public class Customers { return pool.remove(userNickname); } + /** + * + * @param nickname Find User by nickname + * @return + */ public User getByNickname(String nickname) { return pool.get(nickname); } From dce6920ce72fb485b4af7441827be7dd840ccc8b Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:31:18 +0100 Subject: [PATCH 25/36] Added: Javadoc for Customers getCountOfUsers() --- projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java index a381188..86a4a94 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java @@ -40,6 +40,10 @@ public class Customers { return pool.get(nickname); } + /** + * + * @return Number of Users. + */ public int getCountOfUsers() { return pool.size(); } From cdfcc71399d7f241855f5959a3c4b1b23415aa88 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:33:49 +0100 Subject: [PATCH 26/36] Added: Javadoc for Customers nickNameAvailable() --- .../src/main/java/de/hs_fulda/ciip/projjpn/Customers.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java index 86a4a94..e2fd71a 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java @@ -5,6 +5,12 @@ import java.util.HashMap; public class Customers { HashMap pool = new HashMap(); + /** + * + * @param nickname Is the particular Nickname free to use? + * @return true if nickname is Available. + * @return false if nickname is Available. + */ public boolean nickNameAvailable(String nickname) { User u = pool.get(nickname); if (null == u) { From 12e0edc42ddd94273c7415d0724963f21154e2b1 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:36:19 +0100 Subject: [PATCH 27/36] Added: Javadoc for Birthday isValid() --- .../src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java index 32ed901..9ab68bf 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java @@ -42,6 +42,14 @@ public class Birthdate { year = y; } + /** + * + * @param DD + * @param MM + * @param YYYY + * @return true if date is valid. + * @return false if date is invalid. + */ public boolean isValid(int DD, int MM, int YYYY) { if (DD < 1 || DD > 31) { return false; From 04dd0a90b219575a3d35031c1eafaca4aed59362 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:38:10 +0100 Subject: [PATCH 28/36] Added: Javadoc for UserTest test_initAndGetBirthdayOfUser() --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java index 419153e..5598b71 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java @@ -3,6 +3,9 @@ package de.hs_fulda.ciip.projjpn; import junit.framework.TestCase; public class UserTest extends TestCase { + /** + * Create User with a valid Birthday and check whether it worked as intended. + */ public void test_initAndGetBirthdayOfUser() { // Given Customers customers = new Customers(); From 8a996f5b24fc9ce36a21e2766d4738c6ad56d356 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:41:22 +0100 Subject: [PATCH 29/36] Added: ItemTest minor refactoring --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 4a5dcc4..652b953 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -3,6 +3,10 @@ package de.hs_fulda.ciip.projjpn; import junit.framework.TestCase; public class ItemTest extends TestCase { + /** + * No Items are in Stock. + * Check the inStock() Method. + */ public void test_ItemNotInStock() { // Given Item item = new Item(); From 41247f580653ef6ba18fb8a86344ddb3b4d00e07 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:42:23 +0100 Subject: [PATCH 30/36] Added: javadoc ItemTest test_ItemInStock() --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 652b953..7de328f 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -18,6 +18,10 @@ public class ItemTest extends TestCase { assertFalse(notInStock); } + /** + * Stock is not Empty. + * Check the inStock() Method. + */ public void test_ItemInStock() { // Given Item item = new Item(); From 36d730a816b145bba1e5166305b45bf27f005b24 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:43:19 +0100 Subject: [PATCH 31/36] Added: javadoc ItemTest test_priceOfMultipleIdenticalItems() --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index 7de328f..c211ab1 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -33,6 +33,10 @@ public class ItemTest extends TestCase { assertTrue(inStock); } + /** + * One and the same type of an item costs the same. + * check getCurrentPrice() + */ public void test_priceOfMultipleIdenticalItems() { // Given Item item = new Item(); From 331a2b84073dcf7978de3fd68042c99838999730 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:44:01 +0100 Subject: [PATCH 32/36] Added: javadoc ItemTest test_buildCompleteItem() --- projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java index c211ab1..aaf8886 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java +++ b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/ItemTest.java @@ -57,6 +57,9 @@ public class ItemTest extends TestCase { assertEquals(expectedPrice, actualPrice); } + /** + * Check if creating a complete item with all attributes works as intended. + */ public void test_buildCompleteItem() { // Given String expectedTitel = "Logitec Maus"; From 29329a7915bdd32eadd8469f12b17b921fdcbc44 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:45:15 +0100 Subject: [PATCH 33/36] Added: javadoc for CustomersTest test_removeRegisteredUser() --- .../src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java | 3 +++ 1 file changed, 3 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 110d7ad..a7384a8 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 @@ -90,6 +90,9 @@ public class CustomersTest extends TestCase { } } + /** + * Test if deletion of an allready registered customer works. + */ public void test_removeRegisteredUser() { // Given Customers customers = new Customers(); From ec603c35f0f8222cda276eedb2a79eadd9800124 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:45:56 +0100 Subject: [PATCH 34/36] Added: javadoc for CustomersTest test_registerAndCountUsers() --- .../src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java | 3 +++ 1 file changed, 3 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 a7384a8..a3a3788 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 @@ -110,6 +110,9 @@ public class CustomersTest extends TestCase { } + /** + * Register a given number of users. + */ public void test_registerAndCountUsers() { // Given Customers customers = new Customers(); From a7e50b722ace594968eee0a2dbc098dbc682164b Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:47:03 +0100 Subject: [PATCH 35/36] Added: javadoc for CustomersTest test_createRegisterAndCheckUserData --- .../src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java | 3 +++ 1 file changed, 3 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 a3a3788..3700e6a 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 @@ -129,6 +129,9 @@ public class CustomersTest extends TestCase { assertEquals(expectedRegisteredUsers, actualRegisteredUsers); } + /** + * Check if the Registration of a User works as intended. + */ public void test_createRegisterAndCheckUserData() { // Given Customers customers = new Customers(); From bfe9534bdd0932cf6c15919ffd2a5ed1ab75b638 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 22:48:30 +0100 Subject: [PATCH 36/36] Added: javadoc for CustomersTest --- .../test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java | 6 ++++++ 1 file changed, 6 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 3700e6a..6dc92c3 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,9 @@ public class CustomersTest extends TestCase { assertTrue(nicknameIsAvailable); } + /** + * Register a user only when the given nickname is available. + */ public void test_nicknameIsTaken() { // Given Customers customers = new Customers(); @@ -32,6 +35,9 @@ public class CustomersTest extends TestCase { assertFalse(nicknameIsTaken); } + /** + * Register a single user and check whether it worked. + */ public void test_registerSingleUser() { // Given Customers customers = new Customers();