Unit test Android, getString from resource

前端 未结 3 1728
既然无缘
既然无缘 2021-02-12 09:59

I am trying to do an unit test for an android app and I need to get a string from res.string resources. The class that I want to test is a POJO class. I am doing the app in two

3条回答
  •  Happy的楠姐
    2021-02-12 10:20

    You don't have a real android Context while you are using JVM unit test. For your case, maybe you can try Android Instrumentation Test, typically it is implemented in the "androidTest" directory of your project.

提交回复
热议问题