@Test public void testDownloadAllFonts_downloadsAllStyles() throws Exception { TestSubscriber<File> testSubscriber = new TestSubscriber<>(); FontDownloader fontDownloader = new FontDownloader(new MockFontPackage(MOCK_FONT_PACK_NAME)); fontDownloader.downloadAllFonts().subscribe(testSubscriber); testSubscriber.assertNoErrors(); List<File> downloadedFiles = testSubscriber.getOnNextEvents(); List<String> downloadedFileNames = new ArrayList<String>() {{ for (File f : downloadedFiles) add(f.getName()); }}; List<Style> expectedStyles = new ArrayList<>(Arrays.asList(Style.values())); List<String> expectedStyleNames = new ArrayList<String>() {{ for (Style s : expectedStyles) add(s.getLocalName()); }}; assertTrue(downloadedFileNames.containsAll(expectedStyleNames)); }
public Observable<File> downloadAllFonts() { Timber.i("downloadAllFonts: " + mFontPackage.getName()); return downloadFonts(mFontPackage.getFontSet()); }
FontDownloader { public Observable<File> downloadAllFonts() { Timber.i("downloadAllFonts: " + mFontPackage.getName()); return downloadFonts(mFontPackage.getFontSet()); } }
FontDownloader { public Observable<File> downloadAllFonts() { Timber.i("downloadAllFonts: " + mFontPackage.getName()); return downloadFonts(mFontPackage.getFontSet()); } FontDownloader(FontPackage fontPackage); }
FontDownloader { public Observable<File> downloadAllFonts() { Timber.i("downloadAllFonts: " + mFontPackage.getName()); return downloadFonts(mFontPackage.getFontSet()); } FontDownloader(FontPackage fontPackage); Observable<File> downloadAllFonts(); Observable<File> downloadFontStyles(Style... styles); static Observable<File> downloadStyleFromPackages(List<FontPackage> packages, Style style); }
FontDownloader { public Observable<File> downloadAllFonts() { Timber.i("downloadAllFonts: " + mFontPackage.getName()); return downloadFonts(mFontPackage.getFontSet()); } FontDownloader(FontPackage fontPackage); Observable<File> downloadAllFonts(); Observable<File> downloadFontStyles(Style... styles); static Observable<File> downloadStyleFromPackages(List<FontPackage> packages, Style style);  }