How to test an Android Library Project

前端 未结 6 2131
一向
一向 2021-01-30 01:28

I am writing an Android Library Project basing on Android Bitmap class (call it AndroindLib) which contains only utility class (no activity). I tried to test it using Android JU

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 01:44

    Quoting the documentation:

    "There are two recommended ways of setting up testing on code and resources in a library project:

    • You can set up a test project that instruments an application project that depends on the library project. You can then add tests to the project for library-specific features.

    • You can set up a standard application project that depends on the library and put the instrumentation in that project. This lets you create a self-contained project that contains both the tests/instrumentations and the code to test."

提交回复
热议问题