From 173063e84d39901afc1aec2921479015f1418f72 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 13 Mar 2012 12:53:04 +0000 Subject: [PATCH] Merchant buy/sell/tradeFoil. --- .../merchant/ParametrizedMerchantTest.java | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/merchant/ParametrizedMerchantTest.java b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/merchant/ParametrizedMerchantTest.java index 1476bf255..4c642fc22 100644 --- a/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/merchant/ParametrizedMerchantTest.java +++ b/gemp-lotr/gemp-lotr-server/src/test/java/com/gempukku/lotro/merchant/ParametrizedMerchantTest.java @@ -31,8 +31,8 @@ public class ParametrizedMerchantTest { assertEqualsMoreOrLess(1000, (int) merchant.getCardBuyPrice("1_2", currentTime)); } - @Test - public void plotPriceAfterSold() { + // @Test + public void plotPricesAfterTransactions() { Date setupDate = new Date(-1000 * 60 * 60 * 24 * 50L); Date firstTrans = new Date(0); @@ -43,33 +43,14 @@ public class ParametrizedMerchantTest { merchant.setMerchantSetupDate(setupDate); merchant.cardSold("1_1", firstTrans, 1000); + merchant.cardBought("1_2", firstTrans, 700); long hour = 1000 * 60 * 60; - System.out.println("-2,1000"); + System.out.println("-2,1000,700,1000,700"); for (long time = 0; time < hour * 24 * 20L; time += hour * 2) { - System.out.println(time / hour + "," + (int) merchant.getCardSellPrice("1_1", new Date(time))); - } - } - - @Test - public void plotPriceAfterBought() { - Date setupDate = new Date(-1000 * 60 * 60 * 24 * 50L); - Date firstTrans = new Date(0); - - MerchantDAO merchantDao = new MockMerchantDAO(); - - ParametrizedMerchant merchant = new ParametrizedMerchant(); - merchant.setMerchantDao(merchantDao); - merchant.setMerchantSetupDate(setupDate); - - merchant.cardBought("1_1", firstTrans, 700); - - long hour = 1000 * 60 * 60; - - System.out.println("-2,1000"); - for (long time = 0; time < hour * 24 * 20L; time += hour * 2) { - System.out.println(time / hour + "," + (int) merchant.getCardSellPrice("1_1", new Date(time))); + System.out.println(time / hour + "," + ((int) merchant.getCardSellPrice("1_1", new Date(time))) + "," + ((int) merchant.getCardBuyPrice("1_1", new Date(time))) + + "," + ((int) merchant.getCardSellPrice("1_2", new Date(time))) + "," + ((int) merchant.getCardBuyPrice("1_2", new Date(time)))); } }