@Test
public void userEditsExchangeRateThenPriceFields() throws Exception {

    presenter = new CurrencyExchangeRateEditorPresenter(currencyExchangeRateEditorView, receiptPricingView, currencyListEditorView, receiptDateView, exchangeRateServiceManager, databaseHelper, trip, null, null, Schedulers.trampoline(), Schedulers.trampoline(), Schedulers.trampoline());
    presenter.subscribe();
    exchangedPriceInBaseCurrencyFocusChanges.onNext(false);
    currencyClicks.onNext(1);
    exchangeRateChanges.onNext("");
    exchangeRateChanges.onNext("0");
    exchangeRateChanges.onNext("0.1");
    exchangeRateChanges.onNext("0.");
    exchangeRateChanges.onNext("0.2");
    final InOrder inOrderVerifier = inOrder(displayExchangedPriceInBaseCurrencyConsumer);
    receiptPriceChanges.onNext("");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.absent());
    receiptPriceChanges.onNext("1");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("0.2").build()));
    receiptPriceChanges.onNext("10");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("10.");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("10.0");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("10.00");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("10.0");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("10.");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("10");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("2").build()));
    receiptPriceChanges.onNext("1");
    inOrderVerifier.verify(displayExchangedPriceInBaseCurrencyConsumer).accept(Optional.of(new PriceBuilderFactory().setCurrency(TRIP_CURRENCY).setPrice("0.2").build()));
}