FilePickerProxy { private Pattern getPattern(AssetType assetType) { return Pattern.compile(String.format(FILE_PATTERN, assetType.getPattern())); }  void openFilePicker(Fragment fragment, AssetType assetType); boolean isPickFileRequested(int requestCode, AssetType assetType); boolean isFilePicked(int resultCode); String getFilePath(Intent data);  }
@Test public void whenGettingPatternForPictureExpectPatternToMatchLowercasepng() throws Exception { Pattern pattern = getPattern(AssetType.PICTURE); assertTrue(pattern.matcher("test.png").matches()); }
@Test public void whenGettingPatternForPictureExpectPatternToMatchUppercasePNG() throws Exception { Pattern pattern = getPattern(AssetType.PICTURE); assertTrue(pattern.matcher("test.PNG").matches()); }
@Test public void whenGettingPatternForSoundExpectPatternToMatchMp3() throws Exception { Pattern pattern = getPattern(AssetType.SOUND); assertTrue(pattern.matcher("test.mp3").matches()); }
@Test public void whenGettingPatternForSoundExpectPatternToNotMatchOnlyExtension() throws Exception { Pattern pattern = getPattern(AssetType.SOUND); assertFalse(pattern.matcher(".mp3").matches()); }