use of com.nytimes.android.external.store3.base.impl.BarCode in project Store by NYTimes.
the class ClearStoreMemoryTest method testClearSingleBarCode.
@Test
public void testClearSingleBarCode() {
// one request should produce one call
BarCode barcode = new BarCode("type", "key");
store.get(barcode).test().awaitTerminalEvent();
assertThat(networkCalls).isEqualTo(1);
// after clearing the memory another call should be made
store.clearMemory(barcode);
store.get(barcode).test().awaitTerminalEvent();
assertThat(networkCalls).isEqualTo(2);
}
use of com.nytimes.android.external.store3.base.impl.BarCode in project Store by NYTimes.
the class DontCacheErrorsTest method testStoreDoesntCacheErrors.
@Test
public void testStoreDoesntCacheErrors() throws InterruptedException {
BarCode barcode = new BarCode("bar", "code");
shouldThrow = true;
store.get(barcode).test().assertTerminated().assertError(Exception.class).awaitTerminalEvent();
shouldThrow = false;
store.get(barcode).test().assertNoErrors().awaitTerminalEvent();
}
use of com.nytimes.android.external.store3.base.impl.BarCode in project Store by NYTimes.
the class DontCacheErrorsTest method testStoreDoesntCacheErrorsWithResult.
@Test
public void testStoreDoesntCacheErrorsWithResult() throws InterruptedException {
BarCode barcode = new BarCode("bar", "code");
shouldThrow = true;
store.getWithResult(barcode).test().assertTerminated().assertError(Exception.class).awaitTerminalEvent();
shouldThrow = false;
store.get(barcode).test().assertNoErrors().awaitTerminalEvent();
}
Aggregations