# Testing With Koin

> Tests that don't need Koin, startKoin/stopKoin hygiene, and AppGraphTest building the whole graph on Android and iOS.

- URL: https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-12-testing-with-koin
- Course: [Mobile Action Pro](https://dantech.academy/en/courses/kotlin-accelerator.md)
- Module: Dependency Injection with Koin
- Duration: 25 min
- Difficulty: intermediate
- Access: Enrolled students
- Tiếng Việt: https://dantech.academy/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-12-testing-with-koin.md

## Objectives

- Test ViewModels and use cases through constructors and fakes, without starting Koin
- Keep Koin clean between tests with startKoin and stopKoin
- Read AppGraphTest, the two-way allowlist and AndroidProcessGraphTest to catch missing bindings on both platforms

## In this lesson

1. Lesson Goal
2. Part 1: Most Tests Don't Need Koin
3. Part 2: koin-test And Hygiene Between Tests
4. Part 3: AppGraphTest Builds The Whole Graph
5. Part 4: An Allowlist Checked In Both Directions
6. Part 5: The Part Of The Graph commonTest Can't See
7. Practice Exercise
8. Code Reading Path
9. Signs To Avoid
10. References
11. Key Points

## Study with an AI agent

The full lesson is for students of this course. Students open the lesson on the web and press **Markdown** to copy all of it, then paste it into Claude, ChatGPT, Cursor or whichever agent you use. Faster: mint a token at `/profile/ai-agents` and your agent reads lessons over MCP.

- [Join the course](https://dantech.academy/en/kotlin-accelerator/checkout)

---

- Previous lesson: [ViewModel Injection In Routes](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-11-viewmodel-injection-routes.md)
- Next lesson: [Migrating An Android App To KMP](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/08-capstone-kmp-migration/lesson-01-migrate-android-app-to-kmp.md)
