Android Test Project - Reading assets file to test plain java object

后端 未结 3 662
忘了有多久
忘了有多久 2020-12-21 17:50

My project setup

  • Library Project A Contains a fooJSONParser like this :

    public class fooJsonParser {
      ...
      // Co         
    
    
            
3条回答
  •  半阙折子戏
    2020-12-21 17:59

    I got this solved by the following :

    • Created the setup as explained here
    • Extended the InstrumentationTestCase instead of TestCase. The InstrumentationTestCase has the method getInstrument() through which I got access to the Instrumentation's(The test app project) Context.

提交回复
热议问题