Closed hebamahdy closed 10 months ago
URL of codelab https://developer.android.com/codelabs/android-basics-kotlin-test-viewmodel-and-livedata?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fandroid-basics-kotlin-test-viewmodel-and-livedata#0
In which task and step of the codelab can this issue be found?
https://developer.android.com/codelabs/android-basics-kotlin-test-viewmodel-and-livedata?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fandroid-basics-kotlin-test-viewmodel-and-livedata#5 Describe the problem
you should set date before test the price
@Test fun price_twelve_cupcakes() { val viewModel = OrderViewModel() viewModel.price.observeForever {} viewModel.setQuantity(12) viewModel.date.observeForever{} viewModel.setDate( viewModel.getPickupOptions()[0]) assertEquals("$27.00", viewModel.price.value) } Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.
URL of codelab https://developer.android.com/codelabs/android-basics-kotlin-test-viewmodel-and-livedata?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fandroid-basics-kotlin-test-viewmodel-and-livedata#0
In which task and step of the codelab can this issue be found?
https://developer.android.com/codelabs/android-basics-kotlin-test-viewmodel-and-livedata?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fandroid-basics-kotlin-test-viewmodel-and-livedata#5 Describe the problem
you should set date before test the price
@Test fun price_twelve_cupcakes() { val viewModel = OrderViewModel() viewModel.price.observeForever {} viewModel.setQuantity(12) viewModel.date.observeForever{} viewModel.setDate( viewModel.getPickupOptions()[0]) assertEquals("$27.00", viewModel.price.value) } Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.