Guest User

Untitled

a guest
Nov 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. @Test
  2. fun getUserAsLiveDataTest() {
  3. val user = User(userName = "Test User")
  4. appDatabase.userDao().insertUser(user)
  5. val userWrappedInLiveData = appDatabase.userDao().userAsLiveData
  6. val userFromDb = userWrappedInLiveData.getValueBlocking()
  7. assertEquals(userFromDb?.userName, user.userName)
  8. }
Add Comment
Please, Sign In to add comment