1
1
package org .andstatus .todoagenda ;
2
2
3
- import static org .junit .Assert .assertEquals ;
3
+ import static org .andstatus .todoagenda .prefs .InstanceSettings .EVENT_RANGE_TODAY ;
4
+ import static org .andstatus .todoagenda .prefs .InstanceSettings .EVENT_RANGE_TODAY_AND_TOMORROW ;
4
5
5
6
import org .andstatus .todoagenda .provider .QueryResultsStorage ;
6
7
import org .andstatus .todoagenda .widget .WidgetEntryPosition ;
@@ -15,11 +16,18 @@ public class TomorrowsTasksInTodaysFilterTest extends BaseWidgetTest {
15
16
public void testIssue102 () {
16
17
final String method = "testIssue102" ;
17
18
QueryResultsStorage inputs = provider .loadResultsAndSettings (
18
- org .andstatus .todoagenda .test .R .raw .tomorrows_tasks_today );
19
+ org .andstatus .todoagenda .test .R .raw .tomorrows_tasks_one_week );
19
20
provider .addResults (inputs );
20
21
21
22
playResults (method );
22
- assertEquals ("Number of entries, " + getFactory ().getWidgetEntries (), 1 , getFactory ().getWidgetEntries ().size ());
23
- assertEquals ("No events" , WidgetEntryPosition .LIST_FOOTER , getFactory ().getWidgetEntries ().get (0 ).entryPosition );
23
+ assertPosition (10 , WidgetEntryPosition .LIST_FOOTER );
24
+
25
+ getSettings ().eventRange = EVENT_RANGE_TODAY ;
26
+ playResults (method );
27
+ assertPosition (0 , WidgetEntryPosition .LIST_FOOTER );
28
+
29
+ getSettings ().eventRange = EVENT_RANGE_TODAY_AND_TOMORROW ;
30
+ playResults (method );
31
+ assertPosition (7 , WidgetEntryPosition .LIST_FOOTER );
24
32
}
25
33
}
0 commit comments