This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 1, | |
"cuisine": 1, | |
"lat": -33.431756, | |
"lng": -70.578719, | |
"price": 8900, | |
"image": "https://www.atrapalo.cl/common/photo/res/44559/106814/ticr_0_0.jpg", | |
"description": "Todo el sabor del Perú está presente en el restaurante Mi Cevichazo." | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4::class) | |
class RestaurantsRepositoryTest { | |
@Rule | |
@JvmField | |
var instantExecutor = InstantTaskExecutorRule() | |
@Mock | |
private lateinit var observer: Observer<Resource<List<Restaurant>>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4::class) | |
class RestaurantsMapActivityTest { | |
@Rule | |
@JvmField | |
var activityRule = ActivityTestRule(RestaurantsMapActivity::class.java) | |
companion object { | |
val packageName = BuildConfig.APPLICATION_ID | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginViewModel @Inject constructor(private val repository: UsersRepository) : ViewModel() { | |
var loginInput: MutableLiveData<LoginRequest> = MutableLiveData() | |
val login: LiveData<Resource<User>> = Transformations.switchMap(loginInput) { emailPasswordRequest -> | |
repository.login(emailPasswordRequest) | |
} | |
} | |
class LoginActivity : BaseActivity() { | |
//... |
OlderNewer