Search in sources :

Example 1 with DBQuery

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());
}
Also used : DBQuery(com.newsrob.DBQuery)

Example 2 with DBQuery

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));
}
Also used : DBQuery(com.newsrob.DBQuery)

Example 3 with DBQuery

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));
}
Also used : DBQuery(com.newsrob.DBQuery)

Example 4 with DBQuery

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());
}
Also used : DBQuery(com.newsrob.DBQuery)

Example 5 with DBQuery

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());
}
Also used : Entry(com.newsrob.Entry) DBQuery(com.newsrob.DBQuery)

Aggregations

DBQuery (com.newsrob.DBQuery)32 Feed (com.newsrob.Feed)7 Intent (android.content.Intent)3 Entry (com.newsrob.Entry)2 ArrayList (java.util.ArrayList)2 AppWidgetManager (android.appwidget.AppWidgetManager)1 Cursor (android.database.Cursor)1 Bundle (android.os.Bundle)1 TypedValue (android.util.TypedValue)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 ProgressBar (android.widget.ProgressBar)1 RemoteViews (android.widget.RemoteViews)1 TextView (android.widget.TextView)1 Date (java.util.Date)1