use of org.odk.collect.android.formmanagement.matchexactly.SyncStatusAppState in project collect by opendatakit.
the class SyncStatusAppStateTest method isSyncing_isDifferentForDifferentProjects.
@Test
public void isSyncing_isDifferentForDifferentProjects() {
SyncStatusAppState syncStatusAppState = new SyncStatusAppState(context);
syncStatusAppState.startSync("projectId");
assertThat(syncStatusAppState.isSyncing("projectId").getValue(), is(true));
assertThat(syncStatusAppState.isSyncing("otherProjectId").getValue(), is(false));
}
use of org.odk.collect.android.formmanagement.matchexactly.SyncStatusAppState in project collect by opendatakit.
the class SyncStatusAppStateTest method getSyncError_whenFinishSyncWithException_isException.
@Test
public void getSyncError_whenFinishSyncWithException_isException() {
SyncStatusAppState syncStatusAppState = new SyncStatusAppState(context);
syncStatusAppState.startSync("projectId");
FormSourceException exception = new FormSourceException.FetchError();
syncStatusAppState.finishSync("projectId", exception);
assertThat(syncStatusAppState.getSyncError("projectId").getValue(), is(exception));
}
use of org.odk.collect.android.formmanagement.matchexactly.SyncStatusAppState in project collect by opendatakit.
the class SyncStatusAppStateTest method getSyncError_whenFinishSyncWithNull_isNull.
@Test
public void getSyncError_whenFinishSyncWithNull_isNull() {
SyncStatusAppState syncStatusAppState = new SyncStatusAppState(context);
syncStatusAppState.startSync("projectId");
syncStatusAppState.finishSync("projectId", null);
assertThat(syncStatusAppState.getSyncError("projectId").getValue(), is(nullValue()));
}
use of org.odk.collect.android.formmanagement.matchexactly.SyncStatusAppState in project collect by opendatakit.
the class SyncStatusAppStateTest method getSyncError_isNullAtFirst.
@Test
public void getSyncError_isNullAtFirst() {
SyncStatusAppState syncStatusAppState = new SyncStatusAppState(context);
assertThat(syncStatusAppState.getSyncError("projectId").getValue(), is(nullValue()));
}
use of org.odk.collect.android.formmanagement.matchexactly.SyncStatusAppState in project collect by opendatakit.
the class SyncStatusAppStateTest method getSyncError_isDifferentForDifferentProjects.
@Test
public void getSyncError_isDifferentForDifferentProjects() {
SyncStatusAppState syncStatusAppState = new SyncStatusAppState(context);
syncStatusAppState.startSync("projectId");
syncStatusAppState.finishSync("projectId", new FormSourceException.FetchError());
assertThat(syncStatusAppState.getSyncError("projectId").getValue(), is(notNullValue()));
assertThat(syncStatusAppState.getSyncError("otherProjectId").getValue(), is(nullValue()));
}
Aggregations