最佳答案
在单元测试中,如何在不对路径进行硬编码的情况下从我的(桌面)文件系统上的 json 文件读取数据?
我希望从文件中读取测试输入(用于我的解析方法) ,而不是创建静态 String。
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.