Modify test display for price checking.

This commit is contained in:
marcins78
2012-12-21 14:41:03 +00:00
parent e75a650d91
commit 5aae32a504

View File

@@ -73,7 +73,7 @@ public class StorageBasedMerchantTest {
assertTrue(initialPrice > _merchant.getCardBuyPrice("1_1", new Date(DAY)));
}
@Test
// @Test
public void plotPricesAfterTransactions() {
Date setupDate = new Date(-1000 * 60 * 60 * 24 * 50L);
Date firstTrans = new Date(0);
@@ -89,11 +89,15 @@ public class StorageBasedMerchantTest {
System.out.println("-2,1000,700,1000,700");
for (long time = 0; time < hour * 24 * 35L; time += hour * 2) {
System.out.println((time / hour /24f) + "," + merchant.getCardSellPrice("1_1", new Date(time)) + "," + merchant.getCardBuyPrice("1_1", new Date(time))
System.out.println("After "+formatTimeInHours(hour, time) + "," + merchant.getCardSellPrice("1_1", new Date(time)) + "," + merchant.getCardBuyPrice("1_1", new Date(time))
+ "," + merchant.getCardSellPrice("1_2", new Date(time)) + "," + merchant.getCardBuyPrice("1_2", new Date(time)));
}
}
private String formatTimeInHours(long hour, long time) {
return (time / (24*hour))+" days, "+((time/hour)%24)+" hours";
}
// @Test
public void plotPriceEasingFromSetup() {
@@ -106,7 +110,7 @@ public class StorageBasedMerchantTest {
long hour = 1000 * 60 * 60;
for (long time = 0; time < hour * 24 * 35L; time += hour * 2)
System.out.println((time / hour /24f) + "," + merchant.getCardSellPrice("1_1", new Date(time)) + "," + merchant.getCardBuyPrice("1_1", new Date(time)));
System.out.println("After "+formatTimeInHours(hour, time) + "," + merchant.getCardSellPrice("1_1", new Date(time)) + "," + merchant.getCardBuyPrice("1_1", new Date(time)));
}
private void assertEqualsMoreOrLess(int expected, int given) {