Modify test display for price checking.
This commit is contained in:
@@ -73,7 +73,7 @@ public class StorageBasedMerchantTest {
|
|||||||
assertTrue(initialPrice > _merchant.getCardBuyPrice("1_1", new Date(DAY)));
|
assertTrue(initialPrice > _merchant.getCardBuyPrice("1_1", new Date(DAY)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
public void plotPricesAfterTransactions() {
|
public void plotPricesAfterTransactions() {
|
||||||
Date setupDate = new Date(-1000 * 60 * 60 * 24 * 50L);
|
Date setupDate = new Date(-1000 * 60 * 60 * 24 * 50L);
|
||||||
Date firstTrans = new Date(0);
|
Date firstTrans = new Date(0);
|
||||||
@@ -89,11 +89,15 @@ public class StorageBasedMerchantTest {
|
|||||||
|
|
||||||
System.out.println("-2,1000,700,1000,700");
|
System.out.println("-2,1000,700,1000,700");
|
||||||
for (long time = 0; time < hour * 24 * 35L; time += hour * 2) {
|
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)));
|
+ "," + 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
|
// @Test
|
||||||
public void plotPriceEasingFromSetup() {
|
public void plotPriceEasingFromSetup() {
|
||||||
@@ -106,7 +110,7 @@ public class StorageBasedMerchantTest {
|
|||||||
long hour = 1000 * 60 * 60;
|
long hour = 1000 * 60 * 60;
|
||||||
|
|
||||||
for (long time = 0; time < hour * 24 * 35L; time += hour * 2)
|
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) {
|
private void assertEqualsMoreOrLess(int expected, int given) {
|
||||||
|
|||||||
Reference in New Issue
Block a user