diff --git a/MerchantRPGCSE2102/src/tests/testMerchant.java b/MerchantRPGCSE2102/src/tests/testMerchant.java index 54c5d07..342dbb4 100644 --- a/MerchantRPGCSE2102/src/tests/testMerchant.java +++ b/MerchantRPGCSE2102/src/tests/testMerchant.java @@ -13,6 +13,7 @@ public void setup() m = new Merchant("Test", 100, 2); } + //testing cash system public void testCashSystem() throws Exception { setup(); @@ -24,12 +25,29 @@ public void testCashSystem() throws Exception assertEquals(80, m.getCurrentCash()); } + //testing randomizer + public void testRandomizer() throws Exception + { + setup(); + boolean testCheck = false; + m.setDailyRandomPrice(10, 50); + + if(10 <= m.getRandomPrice() && 50 >= m.getRandomPrice()) + { + testCheck = true; + } + + assertEquals(true, testCheck); + } + + //testing inventory public void testInventory() throws Exception { setup(); assertEquals(2, m.getInventory().length); } + //testing name public void testName() throws Exception { setup();