Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MockK and Truth - Unit Tests - Android
Search
Moro
January 03, 2022
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MockK and Truth - Unit Tests - Android
First contact with the libraries: MockK and Truth.
Moro
January 03, 2022
More Decks by Moro
See All by Moro
More Accessible Apps - Android
gabrielbmoro
0
12
Variables and Tips - Android
gabrielbmoro
0
12
Migrating an Existing App to Compose - Android
gabrielbmoro
0
15
Recycler View and Performance - Android
gabrielbmoro
0
14
Repository Pattern and Productivity - Android
gabrielbmoro
0
16
What is new in Android Jetpack?
gabrielbmoro
0
21
List Users - Android
gabrielbmoro
0
6
Working with Collections - Kotlin
gabrielbmoro
0
18
Dependency Inversion - Example
gabrielbmoro
0
15
Other Decks in Programming
See All in Programming
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
7
4.2k
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
340
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
140
RTSPクライアントを自作してみた話
simotin13
0
600
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
570
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
750
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
330
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
540
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
540
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
780
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
280
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
160
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
140
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
220
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
HDC tutorial
michielstock
2
710
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
220
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Transcript
Mockk & Truth Your Unit Tests better for reading By
Moro
MockK It is a powerful mocking library for Kotlin It
is a library to help us write more fluent assertions for Android. Truth
Example In this case, the MainViewModel has the responsibility for
defining the first destination, where the app starts. Has email stored? Dashboard Screen Welcome Screen Yes No
MainViewModel
MainViewModel Dependency
Mocking the Dependency
Mocking the Dependency
MainViewModel Test - Case #1 Has email stored? Dashboard Screen
Yes
MainViewModel Test - Case #2 Has email stored? Welcome Screen
No
None