use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadWithFewerRecordsThanLimit.
public void testMarkAllReadWithFewerRecordsThanLimit() throws InterruptedException {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setLimit(44);
executeMarkAllRead(dbq);
assertEquals(0, entryManager.getUnreadArticleCount());
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testOnlyUnreadArticlesAreCounted.
public void testOnlyUnreadArticlesAreCounted() {
DBQuery dbq = new DBQuery(entryManager, null, null);
assertEquals(4, entryManager.getMarkAllReadCount(dbq));
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadIgnoresHideReadItemsPreference.
public void testMarkAllReadIgnoresHideReadItemsPreference() {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(true);
assertEquals(4, entryManager.getMarkAllReadCount(dbq));
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(false);
assertEquals(4, entryManager.getMarkAllReadCount(dbq));
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadWithLimitAscending.
public void testMarkAllReadWithLimitAscending() throws InterruptedException {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setSortOrderAscending(true);
dbq.setLimit(1);
executeMarkAllRead(dbq);
assertEquals(3, entryManager.getUnreadArticleCount());
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class PinTests method testMarkAllReadDoesntMarkPinnedArticlesRead.
public void testMarkAllReadDoesntMarkPinnedArticlesRead() throws InterruptedException {
TestUtil.populateDatabaseWithDataSet1(entryManager);
Entry article = entryManager.findEntryByAtomId("atomid5");
entryManager.increaseUnreadLevel(article);
article = entryManager.findEntryByAtomId("atomid5");
assertEquals(ReadState.PINNED, article.getReadState());
DBQuery dbq = new DBQuery(entryManager, null, null);
executeMarkAllRead(dbq);
assertEquals(1, entryManager.getUnreadArticleCount());
}
Aggregations