HoangNguyen0403

Android Testing

Standards for Unit Tests, UI Tests (Compose), and Hilt Integration

HoangNguyen0403 581 164 Actualitzat fa 9 mesos

Recursos

1
GitHub

Instal·la

npx skillscat add hoangnguyen0403/agent-skills-standard/android-testing

Instal·la des del registre de SkillsCat.

SKILL.md

Android Testing Standards

Priority: P0

Implementation Guidelines

Unit Tests

  • Scope: ViewModels, Usecases, Repositories, Utils.
  • Coroutines: Use runTest (kotlinx-coroutines-test). Use MainDispatcherRule to mock Main dispatcher.
  • Mocking: Use MockK.

UI Integration Tests (Instrumentation)

  • Scope: Composable Screens, Navigation flows.
  • Rules: Use createAndroidComposeRule + Hilt (HiltAndroidRule).
  • Isolation: Fake repositories in DI modules (@TestInstallIn).

Anti-Patterns

  • Real Network: **No Real APIs**: Always mock network calls.
  • Flaky Delays: **No Thread.sleep**: Use IdlingResource or 'waitUntil'.

References