Datastore Unit Test

Open
#1,791 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile, testing

Research direction

Compare NiaPreferencesDataSourceTest.kt under core/datastore/src/test with NewsResourceDaoTest.kt under core/database/src/androidTest. Read the linked DataStore and testing article, then run the relevant instrumented test setup. Done means NiaPreferencesDataSourceTest runs as an instrumented test without the temporary-folder or fake-class approach described in the issue.

Written by the indexing model from the issue text.

Description

Since we are using NetworkResourceDaoTest as Instrumented test, why don't we do this with NiaPreferencesDataSourceTest too?

Previous test was also storing the datastore file on Temp Folder(Buggy on some platforms) and now it became a fake class. There was also an old DataStore and testing article for this.

Dominant language
Kotlin
Stars
22.1k
Forks
4.7k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/nowinandroid

All issues in android/nowinandroid

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.