Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Nov 12, 2018
1 parent 9f9349c commit 16e4b72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public void testMaxCharactersForFiatBuyPrice() {
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
Expand All @@ -132,9 +132,9 @@ public void testMaxCharactersForFiatBuyVolume() {
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
Expand Down Expand Up @@ -179,11 +179,11 @@ public void testMaxCharactersForFiatSellPrice() {

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
Expand All @@ -210,8 +210,8 @@ public void testMaxCharactersForFiatSellVolume() {
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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void testFormatCoin() {

@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")))));
}
Expand Down

0 comments on commit 16e4b72

Please sign in to comment.