cannot run the test based on the provided code on codelabs
import com.example.traintipcalculator.calculateTip
import org.junit.Assert.assertEquals
import org.junit.Test
import java.text.NumberFormat
class TipCalculatorTests {
@Test
fun calculateTip_20PercentNoRoundup() {
val amount = 10.00
val tipPercent = 20.00
val expectedTip = NumberFormat.getCurrencyInstance().format(2)
val actualTip = calculateTip(amount = amount, tipPercent = tipPercent, false)
assertEquals(expectedTip, actualTip)
}
}
error
Method getCurrencyInstance in android.icu.text.NumberFormat not mocked. See http://g.co/androidstudio/not-mocked for details. java.lang.RuntimeException: Method getCurrencyInstance in android.icu.text.NumberFormat not mocked. See http://g.co/androidstudio/not-mocked for details.
cannot run the test based on the provided code on codelabs
error
Method getCurrencyInstance in android.icu.text.NumberFormat not mocked. See http://g.co/androidstudio/not-mocked for details. java.lang.RuntimeException: Method getCurrencyInstance in android.icu.text.NumberFormat not mocked. See http://g.co/androidstudio/not-mocked for details.