* Every @Test will fail if the argument "argument1" has the value "make_test_fail". See README * for more information. * */ @Before public void checkCustomArgument() { // Get the arguments bundle. Bundle arguments = InstrumentationRegistry.getArguments(); // Get the value if "argument1" exists String argument1 = arguments.getString("argument1"); // Do something with the value. In this example it will make the test fail but it can be // used to modify a value in SharedPreferences or set the hostname of a backend server, // for example. assertThat(argument1, not(equalTo("make_test_fail"))); } @Before public void initTargetContext() { mContext = getTargetContext(); assertThat(mContext, notNullValue()); } @Test public void verifyResourceFromLibrary() { assertThat(mContext.getString(R.string.library_module_hello_world), is(equalTo("Hello from an Android library module!"))); } @Test public void verifyClassFromLibrary() { AndroidLibraryModuleClass libraryModuleInstance = new AndroidLibraryModuleClass(); assertThat(libraryModuleInstance.isReady(), is(true)); } }