From 16e4b72d4d31383155ed2e73341b6cc7207f9008 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Mon, 12 Nov 2018 00:25:25 -0500 Subject: [PATCH] Fix tests --- .../offerbook/OfferBookChartViewModelTest.java | 18 +++++++++--------- .../bisq/desktop/util/BSFormatterTest.java | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java index b1d83665ed..6e1e303e69 100644 --- a/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java @@ -103,9 +103,9 @@ public class OfferBookChartViewModelTest { model.activate(); assertEquals(7, model.maxPlacesForBuyPrice.intValue()); offerBookListItems.addAll(make(btcBuyItem.but(with(OfferBookListItemMaker.price, 94016475L)))); - assertEquals(7, model.maxPlacesForBuyPrice.intValue()); + assertEquals(9, model.maxPlacesForBuyPrice.intValue()); // 9401.6475 offerBookListItems.addAll(make(btcBuyItem.but(with(OfferBookListItemMaker.price, 101016475L)))); - assertEquals(7, model.maxPlacesForBuyPrice.intValue()); + assertEquals(10, model.maxPlacesForBuyPrice.intValue()); //10101.6475 } @Test @@ -132,9 +132,9 @@ public class OfferBookChartViewModelTest { model.activate(); assertEquals(4, model.maxPlacesForBuyVolume.intValue()); //0.01 offerBookListItems.addAll(make(btcBuyItem.but(with(OfferBookListItemMaker.amount, 100000000L)))); - assertEquals(4, model.maxPlacesForBuyVolume.intValue()); //10.00 + assertEquals(5, model.maxPlacesForBuyVolume.intValue()); //10.00 offerBookListItems.addAll(make(btcBuyItem.but(with(OfferBookListItemMaker.amount, 22128600000L)))); - assertEquals(4, model.maxPlacesForBuyVolume.intValue()); //2212.86 + assertEquals(7, model.maxPlacesForBuyVolume.intValue()); //2212.86 } @Test @@ -179,11 +179,11 @@ public class OfferBookChartViewModelTest { final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, null, new BSFormatter()); model.activate(); - assertEquals(7, model.maxPlacesForSellPrice.intValue()); + assertEquals(7, model.maxPlacesForSellPrice.intValue()); // 10.0000 default price offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 94016475L)))); - assertEquals(7, model.maxPlacesForSellPrice.intValue()); + assertEquals(9, model.maxPlacesForSellPrice.intValue()); // 9401.6475 offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 101016475L)))); - assertEquals(7, model.maxPlacesForSellPrice.intValue()); + assertEquals(10, model.maxPlacesForSellPrice.intValue()); // 10101.6475 } @Test @@ -210,8 +210,8 @@ public class OfferBookChartViewModelTest { model.activate(); assertEquals(4, model.maxPlacesForSellVolume.intValue()); //0.01 offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount, 100000000L)))); - assertEquals(4, model.maxPlacesForSellVolume.intValue()); //10.00 + assertEquals(5, model.maxPlacesForSellVolume.intValue()); //10.00 offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.amount, 22128600000L)))); - assertEquals(4, model.maxPlacesForSellVolume.intValue()); //2212.86 + assertEquals(7, model.maxPlacesForSellVolume.intValue()); //2212.86 } } diff --git a/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java b/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java index 58ec574b9f..198f383c02 100644 --- a/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java +++ b/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java @@ -114,7 +114,7 @@ public class BSFormatterTest { @Test public void testFormatVolume() { - assertEquals("0.01", formatter.formatVolume(make(btcUsdOffer), true, 4)); + assertEquals("1.00", formatter.formatVolume(make(btcUsdOffer), true, 4)); assertEquals("100.00", formatter.formatVolume(make(usdVolume))); assertEquals("1774.62", formatter.formatVolume(make(usdVolume.but(with(volumeString, "1774.62"))))); }