use of android.content.SyncStats in project android by JetBrains.
the class UnitTest method instanceFields.
@Test
public void instanceFields() throws Exception {
SyncResult result = mock(SyncResult.class);
Field statsField = result.getClass().getField("stats");
SyncStats syncStats = mock(SyncStats.class);
statsField.set(result, syncStats);
syncStats.numDeletes = 42;
assertEquals(42, result.stats.numDeletes);
}
use of android.content.SyncStats in project android by JetBrains.
the class LibUnitTest method instanceFields.
@Test
public void instanceFields() throws Exception {
SyncResult result = mock(SyncResult.class);
Field statsField = result.getClass().getField("stats");
SyncStats syncStats = mock(SyncStats.class);
statsField.set(result, syncStats);
syncStats.numDeletes = 42;
assertEquals(42, result.stats.numDeletes);
}
Aggregations