filebot/test/net/filebot/media/MediaDetectionTest.java

40 lines
1.1 KiB
Java
Raw Normal View History

2016-02-10 06:47:17 -05:00
package net.filebot.media;
2016-03-13 13:35:31 -04:00
import static java.util.Collections.*;
2016-02-10 06:47:17 -05:00
import static org.junit.Assert.*;
2016-03-13 13:35:31 -04:00
import java.io.File;
import java.util.Locale;
2016-02-10 06:47:17 -05:00
import org.junit.Test;
public class MediaDetectionTest {
@Test
public void parseMovieYear() {
assertEquals("[2009]", MediaDetection.parseMovieYear("Avatar 2009 2100").toString());
assertEquals("[1955]", MediaDetection.parseMovieYear("1898 Sissi 1955").toString());
}
2016-03-13 13:35:31 -04:00
@Test
public void stripFormatInfo() throws Exception {
assertEquals("3.Idiots.PAL.DVD..", MediaDetection.stripFormatInfo("3.Idiots.PAL.DVD.DD5.1.x264"));
}
@Test
public void detectSeriesName() throws Exception {
2016-04-05 14:06:23 -04:00
assertEquals("[]", MediaDetection.detectSeriesNames(singleton(new File("Movie/LOTR.2001.AVC-1080")), false, Locale.ENGLISH).toString());
2016-03-13 13:35:31 -04:00
}
2016-06-30 05:51:07 -04:00
@Test
public void grepImdbId() throws Exception {
assertEquals("[499549]", MediaDetection.grepImdbId("@see http://www.imdb.com/title/tt0499549/").toString());
}
@Test
public void grepTheTvdbId() throws Exception {
assertEquals("[78874]", MediaDetection.grepTheTvdbId("@see http://www.thetvdb.com/?tab=series&id=78874&lid=14").toString());
}
2016-02-10 06:47:17 -05:00
}