### Question:
OfferBookChartViewModel extends ActivatableViewModel { public ObservableList<OfferBookListItem> getOfferBookListItems() { return offerBookListItems; } @Inject  OfferBookChartViewModel(OfferBook offerBook, Preferences preferences, PriceFeedService priceFeedService,
                            AccountAgeWitnessService accountAgeWitnessService, Navigation navigation); void onSetTradeCurrency(TradeCurrency tradeCurrency); List<XYChart.Data<Number, Number>> getBuyData(); List<XYChart.Data<Number, Number>> getSellData(); String getCurrencyCode(); ObservableList<OfferBookListItem> getOfferBookListItems(); ObservableList<OfferListItem> getTopBuyOfferList(); ObservableList<OfferListItem> getTopSellOfferList(); ObservableList<CurrencyListItem> getCurrencyListItems(); Optional<CurrencyListItem> getSelectedCurrencyListItem(); int getMaxNumberOfPriceZeroDecimalsToColorize(Offer offer); int getZeroDecimalsForPrice(Offer offer); String getPrice(Offer offer); String getVolume(Offer offer); final IntegerProperty maxPlacesForBuyPrice; final IntegerProperty maxPlacesForBuyVolume; final IntegerProperty maxPlacesForSellPrice; final IntegerProperty maxPlacesForSellVolume; }### Answer:
@Test public void testMaxCharactersForBuyPriceWithNoOffers() { OfferBook offerBook = mock(OfferBook.class); final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList(); when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, null); assertEquals(0, model.maxPlacesForBuyPrice.intValue()); }
@Test public void testMaxCharactersForBuyVolumeWithNoOffers() { OfferBook offerBook = mock(OfferBook.class); final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList(); when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, null); assertEquals(0, model.maxPlacesForBuyVolume.intValue()); }
@Test public void testMaxCharactersForSellPriceWithNoOffers() { OfferBook offerBook = mock(OfferBook.class); final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList(); when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, null); assertEquals(0, model.maxPlacesForSellPrice.intValue()); }
@Test public void testMaxCharactersForSellVolumeWithNoOffers() { OfferBook offerBook = mock(OfferBook.class); final ObservableList<OfferBookListItem> offerBookListItems = FXCollections.observableArrayList(); when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems); final OfferBookChartViewModel model = new OfferBookChartViewModel(offerBook, empty, null, null, null); assertEquals(0, model.maxPlacesForSellVolume.intValue()); }