diff options
author | Mason Tang <masontang@google.com> | 2010-07-12 17:39:30 -0700 |
---|---|---|
committer | Mason Tang <masontang@google.com> | 2010-07-16 15:02:51 -0700 |
commit | 8e3d430a020744faa21bf4ca24f1a99c36ec5c4f (patch) | |
tree | e1c0ac76999d75f020cfbbdf6389292aea1678ed /tests/src | |
parent | 27a384695cc2c99cfead4613f4782fc50a3c8b79 (diff) | |
download | android_packages_apps_Calendar-8e3d430a020744faa21bf4ca24f1a99c36ec5c4f.tar.gz android_packages_apps_Calendar-8e3d430a020744faa21bf4ca24f1a99c36ec5c4f.tar.bz2 android_packages_apps_Calendar-8e3d430a020744faa21bf4ca24f1a99c36ec5c4f.zip |
Added support for app-configurable week start day
- Users can now optionally override the system locale specified week start day
Change-Id: I44b37743abb719c80b0d79b47d8a308edc9732c9
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/calendar/EditEventHelperTest.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/src/com/android/calendar/EditEventHelperTest.java b/tests/src/com/android/calendar/EditEventHelperTest.java index 0d0c2f9e..0a69ab23 100644 --- a/tests/src/com/android/calendar/EditEventHelperTest.java +++ b/tests/src/com/android/calendar/EditEventHelperTest.java @@ -36,6 +36,7 @@ import android.text.format.Time; import android.text.util.Rfc822Token; import java.util.ArrayList; +import java.util.Calendar; import java.util.LinkedHashSet; import java.util.TimeZone; @@ -1197,49 +1198,50 @@ public class EditEventHelperTest extends AndroidTestCase { @SmallTest public void testUpdateRecurrenceRule() { int selection = EditEventHelper.DOES_NOT_REPEAT; + int weekStart = Calendar.SUNDAY; mModel1 = new CalendarEventModel(); mModel1.mTimezone = Time.TIMEZONE_UTC; mModel1.mStart = 1272665741000L; // Fri, April 30th ~ 3:17PM mModel1.mRrule = "This should go away"; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertNull(mModel1.mRrule); mModel1.mRrule = "This shouldn't change"; selection = EditEventHelper.REPEATS_CUSTOM; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "This shouldn't change"); selection = EditEventHelper.REPEATS_DAILY; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "FREQ=DAILY;WKST=SU"); selection = EditEventHelper.REPEATS_EVERY_WEEKDAY; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "FREQ=WEEKLY;WKST=SU;BYDAY=MO,TU,WE,TH,FR"); selection = EditEventHelper.REPEATS_WEEKLY_ON_DAY; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "FREQ=WEEKLY;WKST=SU;BYDAY=FR"); selection = EditEventHelper.REPEATS_MONTHLY_ON_DAY; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "FREQ=MONTHLY;WKST=SU;BYMONTHDAY=30"); selection = EditEventHelper.REPEATS_MONTHLY_ON_DAY_COUNT; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "FREQ=MONTHLY;WKST=SU;BYDAY=-1FR"); selection = EditEventHelper.REPEATS_YEARLY; - EditEventHelper.updateRecurrenceRule(selection, mModel1); + EditEventHelper.updateRecurrenceRule(selection, mModel1, weekStart); assertEquals(mModel1.mRrule, "FREQ=YEARLY;WKST=SU"); } |