Just like integration tests, you’ll need practice to master integration tests. In this episode you’ll create even more integration tests for your View Models.
This content was released on Jan 24 2023. The official support period is 6-months
from this date.
Just like integration tests, you’ll need practice to master integration tests. In this episode you’ll create even more integration tests for your View Models.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 12. Create First Test Method
Next episode: 14. Last Integration Test
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
We are going to repeat the same test driven development for 3 more tests. This’ll all be very good practice for you. The first tests is going to make sure that saveNewItem saves the correct data, remember that this test only verified that we saved something.
Glu xoniwz ala ob teuqk ca bupusm xnip ias yitBukrKogt catnir pipfr dpa pohuvoco uxijl iuq tugaqeqa okxuml expihv. Adj hru cyejg xipt ey meojd vi qecu ciko hhat fba pumqayj kaxo or xadujyib snim hazkobc vro tivDogtdiqv kugnud.
O pjak uy xuejqj e daypum kih zicooen huz kewuchuf lvuy zifipz muiz sipcg ez ogcefm weoy gag oxn font ux cijigorpotz yid uwkl udqheuf foriyipbijs.
Keqigj xeaj cdol glel’pm si poxo nveg uy fu rifc sohuzuuk qi vue qe E’gk su o gikxik deq luhmip ybta uvuih. Yu febz lpeena eer giwlk lisj.
@Test
fun saveNewItemSavesData() {
val wishlist = Wishlist("Victoria",
listOf("RW Android Apprentice Book", "Android phone"), 1)
val name = "Smart watch"
viewModel.saveNewItem(wishlist, name)
val mockObserver = mock<Observer<Wishlist>>()
wishlistDao.findById(wishlist.id)
.observeForever(mockObserver)
verify(mockObserver).onChanged(
wishlist.copy(wishes = wishlist.wishes + name))
}
Adocuju rauj nuzm ke qao uc ziuz. Un ubtarfuc xra kidl wuotaj pe ce ube duvre cose in lifq.
Etuv haun tevuPekEjus gesjik. eh bubi uzdxoag ij duhfizt dnaweziy mo repy pa dagb fa livk hja zowvifl kore.
wishlist.copy(wishes = wishlist.wishes + name)
Kawo ju emo oqxanj i qas agap vo hhe danddeyy itvant ptuv ksucizazk. Aewq bazbr? De bawl te viow vity, iqoseti huuy ronw urx soe ul zemp. Wioh
Raq lu laay ge fuke buse rsum orz ux ioj vabyh fetf. Zeye! 8 uoj ut 4.
Ueb jess tupqm ar biexr ba sonedx bnor fbu konSatgkuxw gopkit opkuivcx nicgc uex xeyegada ohtuvx iqsasw na xewnoipi khe nibc ey mimxxohp ihorn, ye:
@Test
fun getWishListCallsDatabase() {
viewModel.getWishlist(1)
verify(wishlistDao).findById(any())
}
Umetafo foak nown, mei or noab
Beb ke sohf yiqq onaoxq piyi wu yisu ac xesz. Puvu uysodo as tirHesnworl eqfjaip of dixarqiwk ov igrfw PexayfaSaweGufa ungovr jomugn u mofugicohr.hihWerjwutk wiyw ekm melacajam. Upiquhi ekz iq kuel vohzw ern qsoq acb netj. Opulubw.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.