aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/test/cgSettingsTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/test/cgSettingsTest.java')
-rw-r--r--tests/src/cgeo/geocaching/test/cgSettingsTest.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/test/cgSettingsTest.java b/tests/src/cgeo/geocaching/test/cgSettingsTest.java
new file mode 100644
index 0000000..e017de2
--- /dev/null
+++ b/tests/src/cgeo/geocaching/test/cgSettingsTest.java
@@ -0,0 +1,30 @@
+package cgeo.geocaching.test;
+
+import android.test.ActivityInstrumentationTestCase2;
+import cgeo.geocaching.cgSettings;
+import cgeo.geocaching.cgeo;
+
+public class cgSettingsTest extends ActivityInstrumentationTestCase2<cgeo> {
+
+ private cgeo activity;
+
+ public cgSettingsTest() {
+ super("cgeo.geocaching", cgeo.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ activity = getActivity();
+ }
+
+ /**
+ * loads new empty settings, this should work fine without an exception (once there was an exception because of the empty map file string)
+ */
+ public void testSettingsException() {
+ cgSettings settings = new cgSettings(activity, activity.getSharedPreferences("not existing preferences", 0));
+
+ // assert that we really created new settings
+ assertNull(settings.getMapFile());
+ }
+}