Skip to content

Instantly share code, notes, and snippets.

@philipp-spiess
Created May 23, 2015 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipp-spiess/b044d532d3ca6adb7331 to your computer and use it in GitHub Desktop.
Save philipp-spiess/b044d532d3ca6adb7331 to your computer and use it in GitHub Desktop.
@Test
public void testSeasonAndEpisodeNumberExtraction() {
LocalFileService localFileService = new LocalFileService()
File test1 = new File("Breaking.Bad.4.Days.Out.S02E09.mkv");
File test2 = new File("Breaking.Bad.4.Days.Out.02X09.mpg");
Assert.assertTrue(localFileService.hasPattern(test1));
Assert.assertTrue(localFileService.getSeason(test1) == 2);
Assert.assertTrue(localFileService.getEpisode(test1) == 9);
Assert.assertTrue(localFileService.hasPattern(test2));
Assert.assertTrue(localFileService.getSeason(test2) == 2);
Assert.assertTrue(localFileService.getEpisode(test2) == 9);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment