use of bisq.desktop.main.offer.offerbook.OfferBook in project bisq-desktop by bisq-network.
the class OfferBookChartViewModelTest method testMaxCharactersForSellPrice.
@Test
public void testMaxCharactersForSellPrice() {
OfferBook offerBook = mock(OfferBook.class);
PriceFeedService service = mock(PriceFeedService.class);
final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList();
offerBookListItems.addAll(make(OfferBookListItemMaker.btcSellItem));
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, service, null, new BSFormatter());
model.activate();
assertEquals(7, model.maxPlacesForSellPrice.intValue());
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 94016475L))));
assertEquals(9, model.maxPlacesForSellPrice.intValue());
offerBookListItems.addAll(make(btcSellItem.but(with(OfferBookListItemMaker.price, 101016475L))));
assertEquals(10, model.maxPlacesForSellPrice.intValue());
}
use of bisq.desktop.main.offer.offerbook.OfferBook in project bisq-desktop by bisq-network.
the class SpreadViewModelTest method testMaxCharactersForAmountWithNoOffers.
@Test
public void testMaxCharactersForAmountWithNoOffers() {
OfferBook offerBook = mock(OfferBook.class);
final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList();
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);
final SpreadViewModel model = new SpreadViewModel(offerBook, null, new BSFormatter());
assertEquals(0, model.maxPlacesForAmount.intValue());
}
Aggregations