mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
23 lines
708 B
Java
23 lines
708 B
Java
package fr.free.nrw.commons;
|
|
|
|
import android.support.test.runner.AndroidJUnit4;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
|
|
import static org.hamcrest.CoreMatchers.is;
|
|
|
|
// TODO: use Robolectric and make it runnable without a connected device
|
|
@RunWith(AndroidJUnit4.class)
|
|
public class MediaTest {
|
|
@Test public void displayTitleShouldStripExtension() {
|
|
Media m = new Media("File:Example.jpg");
|
|
Assert.assertThat(m.getDisplayTitle(), is("Example"));
|
|
}
|
|
|
|
@Test public void displayTitleShouldUseSpaceForUnderscore() {
|
|
Media m = new Media("File:Example 1_2.jpg");
|
|
Assert.assertThat(m.getDisplayTitle(), is("Example 1 2"));
|
|
}
|
|
}
|