Code improvements
* Replace unchecked casts with checked casts * remove Utility.finViewById * Fix return activity checking * Create UserAction enum * Fix typos * Add instrumented test for error info * ErrorInfo make fields final * Log exception using logger * Add inherited annotations * Resolve deprecation warnings * Remove unused methods from utility * Reformat code * Remove unused methods from Utility and improve getFileExt * Create OnScrollBelowItemsListener
This commit is contained in:
parent
40213b2d6a
commit
b03723c3fb
40 changed files with 2077 additions and 1981 deletions
|
|
@ -31,18 +31,18 @@ import static org.mockito.Mockito.when;
|
|||
public class DownloadManagerImplTest {
|
||||
|
||||
private DownloadManagerImpl downloadManager;
|
||||
private DownloadDataSource dowloadDataSource;
|
||||
private DownloadDataSource downloadDataSource;
|
||||
private ArrayList<DownloadMission> missions;
|
||||
|
||||
@org.junit.Before
|
||||
public void setUp() throws Exception {
|
||||
dowloadDataSource = mock(DownloadDataSource.class);
|
||||
downloadDataSource = mock(DownloadDataSource.class);
|
||||
missions = new ArrayList<>();
|
||||
for(int i = 0; i < 50; ++i){
|
||||
missions.add(generateFinishedDownloadMission());
|
||||
}
|
||||
when(dowloadDataSource.loadMissions()).thenReturn(new ArrayList<>(missions));
|
||||
downloadManager = new DownloadManagerImpl(new ArrayList<String>(), dowloadDataSource);
|
||||
when(downloadDataSource.loadMissions()).thenReturn(new ArrayList<>(missions));
|
||||
downloadManager = new DownloadManagerImpl(new ArrayList<String>(), downloadDataSource);
|
||||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
|
|
@ -82,10 +82,10 @@ public class DownloadManagerImplTest {
|
|||
missions.add(mission);
|
||||
}
|
||||
|
||||
dowloadDataSource = mock(DownloadDataSource.class);
|
||||
when(dowloadDataSource.loadMissions()).thenReturn(new ArrayList<>(missions));
|
||||
downloadManager = new DownloadManagerImpl(new ArrayList<String>(), dowloadDataSource);
|
||||
verify(dowloadDataSource, times(1)).loadMissions();
|
||||
downloadDataSource = mock(DownloadDataSource.class);
|
||||
when(downloadDataSource.loadMissions()).thenReturn(new ArrayList<>(missions));
|
||||
downloadManager = new DownloadManagerImpl(new ArrayList<String>(), downloadDataSource);
|
||||
verify(downloadDataSource, times(1)).loadMissions();
|
||||
|
||||
assertEquals(50, downloadManager.getCount());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue