Search in sources :

Example 1 with MultimediaEditFieldActivity

use of com.ichi2.anki.multimediacard.activity.MultimediaEditFieldActivity in project AnkiChinaAndroid by ankichinateam.

the class BasicImageFieldControllerTest method invalidImageResultDoesNotCrashController.

@Test
public void invalidImageResultDoesNotCrashController() {
    BasicImageFieldController controller = getValidControllerNoImage();
    MultimediaEditFieldActivity activity = setupActivityMock(controller, controller.mActivity);
    ContentResolver mock = MockContentResolver.returningEmptyCursor();
    when(activity.getContentResolver()).thenReturn(mock);
    // Act & Assert
    AnkiAssert.assertDoesNotThrow(() -> performImageResult(controller, new Intent()));
}
Also used : MultimediaEditFieldActivity(com.ichi2.anki.multimediacard.activity.MultimediaEditFieldActivity) Intent(android.content.Intent) ContentResolver(android.content.ContentResolver) MockContentResolver(com.ichi2.testutils.MockContentResolver) Test(org.junit.Test)

Aggregations

ContentResolver (android.content.ContentResolver)1 Intent (android.content.Intent)1 MultimediaEditFieldActivity (com.ichi2.anki.multimediacard.activity.MultimediaEditFieldActivity)1 MockContentResolver (com.ichi2.testutils.MockContentResolver)1 Test (org.junit.Test)1