Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codelab: Advanced WorkManager and Testing #16

Open
CheoR opened this issue Nov 6, 2023 · 1 comment
Open

Codelab: Advanced WorkManager and Testing #16

CheoR opened this issue Nov 6, 2023 · 1 comment

Comments

@CheoR
Copy link

CheoR commented Nov 6, 2023

Write tests for Worker implementations

Specify the language of the codelab if it is not English:

In which task and step of the codelab can this issue be found?

Write a BlurWorker test cleanupWorker_doWork_resultSuccess.

Describe the problem

Example test code results in error and does not match final code in main branch.

... 
           assertThat(result, `is`(ListenableWorker.Result.success()))
... 

// main branch
... 
           assertTrue(result is ListenableWorker.Result.Success)
... 

Versions
Android Studio version: 2022.3.1. Patch 2
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

image

@entropia9
Copy link

It's part of Hamcrest, it should come bundled with JUnit.
image

I don't know why they used that instead of assertTrue, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants