forked from upstream-mirrors/quik
Fix test case
This commit is contained in:
@@ -1,14 +1,11 @@
|
|||||||
package com.moez.QKSMS.common.utils;
|
package com.moez.QKSMS.common.utils;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.moez.QKSMS.ui.MainActivity;
|
|
||||||
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class DateFormatterTest extends AndroidTestCase {
|
public class DateFormatterTest extends AndroidTestCase {
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
@@ -16,7 +13,7 @@ public class DateFormatterTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void test24Hours(){
|
public void test24Hours(){
|
||||||
SharedPreferences prefs = MainActivity.getPrefs(getContext());
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
prefs.edit().putBoolean(SettingsFragment.TIMESTAMPS_24H, true).commit();
|
prefs.edit().putBoolean(SettingsFragment.TIMESTAMPS_24H, true).commit();
|
||||||
assertTrue(DateFormatter.accountFor24HourTime(getContext(), new SimpleDateFormat("h:mm a")).equals(new SimpleDateFormat("H:mm")));
|
assertTrue(DateFormatter.accountFor24HourTime(getContext(), new SimpleDateFormat("h:mm a")).equals(new SimpleDateFormat("H:mm")));
|
||||||
prefs.edit().putBoolean(SettingsFragment.TIMESTAMPS_24H, false).commit();
|
prefs.edit().putBoolean(SettingsFragment.TIMESTAMPS_24H, false).commit();
|
||||||
|
|||||||
Reference in New Issue
Block a user