Skip to content

Instantly share code, notes, and snippets.

@Senemix29
Created March 18, 2021 03:00
Show Gist options
  • Select an option

  • Save Senemix29/b1af076490d1c07374aff3ebde50f690 to your computer and use it in GitHub Desktop.

Select an option

Save Senemix29/b1af076490d1c07374aff3ebde50f690 to your computer and use it in GitHub Desktop.
Example of Android Instrumented Unit Test Using Espresso
@Test
fun shouldReturnNumberOfFilesInsideADirectory() {
//Given
val bananaDirectory = "bananas"
createFileAtInternalDirectory(context, bananaDirectory, "prata")
createFileAtInternalDirectory(context, bananaDirectory, "d'agua")
createFileAtInternalDirectory(context, bananaDirectory, "nanica")
//When
val directoryFileListSize =
FileUtils().getInternalDirectoryFilesListSize(context, bananaDirectory)
//Then
assertEquals(3, directoryFileListSize)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment