lundi 30 mars 2015

Android Studio unit testing: read data (input) file

In a unit test, how can I read data from a json file on my (desktop) file system, without hardcoding the path?


I would like to read test input (for my parsing methods) from a file instead of creating static Strings.


The file is in the same location as my unit testing code, but I can also place it somewhere else in the project if needed. I am using Android Studio.


Aucun commentaire:

Enregistrer un commentaire