Unit test Android, getString from resource

前端 未结 3 1722
既然无缘
既然无缘 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条回答
  •  醉酒成梦
    2021-02-12 10:24

    Untested: would it work to use the below, and probably targetContext?

    android {
       testOptions {
         unitTests {
            includeAndroidResources = true
         }
      }
    }
    

提交回复
热议问题