google / google/ground-android

[Code health] Allow instrumented test fake state to be initialized explicitly

Open
#1,045 0 comments 0 reactions 0 assignees View on GitHub
type: code health
Dominant language
Kotlin
Stars
293
Forks
149
Avg merge
1d 16h
Merged PRs (30d)
42

Description

Test fakes currently need to be set statically so that the instrumented tests have the correct initial state. These fakes are shared with unit tests, and shouldn't set initial state which might influence other test behavior or add complexity and indirection to tests.

Instead of reusing static constant test data, we should expose helper methods to build and set default state, but only relevant state in tests:
https://testing.googleblog.com/2018/02/testing-on-toilet-cleanly-create-test.html

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.