properly update formula after first operation

This commit is contained in:
tibbi 2018-04-03 23:33:35 +02:00
parent be0dea16ae
commit c8a10cd466
2 changed files with 2 additions and 6 deletions

View File

@ -158,7 +158,7 @@ public class MainActivityTest {
press(R.id.btn_2);
press(R.id.btn_equals);
checkResult("2");
checkFormula("");
checkFormula("0+2");
}
@Test

View File

@ -98,12 +98,8 @@ class CalculatorImpl(calculator: Calculator, val context: Context) {
}
private fun calculateResult() {
if (!mIsFirstOperation) {
updateFormula()
}
updateFormula()
val operation = OperationFactory.forId(mLastOperation!!, mBaseValue, mSecondValue)
if (operation != null) {
updateResult(operation.getResult())
}