src/androidTest/java/de/blau/android/util/UploadCheckerTest.java
/**
     * Run the UploadChecker, with unsaved changes
     */
Run the UploadChecker, with unsaved changes
Run the UploadChecker with unsaved changes
@Test
    public void withChanges() {
        StorageDelegator delegator = new StorageDelegator();
        Way w = addWayToStorage(delegator, false);
        assertNotNull(w);
        try {
            delegator.writeToFile(context);
        } catch (IOException e) {
            fail(e.getMessage());
        }
        UploadChecker worker = TestWorkerBuilder.from(context, UploadChecker.class, executor).build();
        Result result = worker.doWork();
        assertEquals(Result.success(), result);
        assertTrue(TestUtils.findNotification(device, context.getResources().getQuantityString(R.plurals.upload_checker_message, 6, 6)));
    }
@ Test public void withChanges ( ) { StorageDelegator delegator = new StorageDelegator ( ) ; Way w = addWayToStorage ( delegator , false ) ; assertNotNull ( w ) ; try { delegator . writeToFile ( context ) ; } catch ( IOException e ) { fail ( e . getMessage ( ) ) ; } UploadChecker worker = TestWorkerBuilder . from ( context , UploadChecker . class , executor ) . build ( ) ; Result result = worker . doWork ( ) ; assertEquals ( Result . success ( ) , result ) ; assertTrue ( TestUtils . findNotification ( device , context . getResources ( ) . getQuantityString ( R . plurals . upload_checker_message , 6 , 6 ) ) ) ; }
Run the UploadChecker, with unsaved changes
Run the UploadChecker with unsaved changes