use of com.ichi2.libanki.Media in project Anki-Android by ankidroid.
the class ImageFieldTest method testNoImagePathConcat.
@Test
public void testNoImagePathConcat() {
String goodImage = "<img src='1.png'/>";
Collection col = collectionWithMediaDirectory("media");
String imageSrc = ImageField.getImageFullPath(col, goodImage);
assertThat("Valid media should have path", imageSrc, equalTo("media/1.png"));
}
use of com.ichi2.libanki.Media in project Anki-Android by ankidroid.
the class ImageFieldTest method collectionWithMediaDirectory.
@CheckResult
protected Collection collectionWithMediaDirectory(String dir) {
Media media = mock(Media.class);
when(media.dir()).thenReturn(dir);
Collection collectionMock = mock(Collection.class);
when(collectionMock.getMedia()).thenReturn(media);
return collectionMock;
}
Aggregations