aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java
diff options
context:
space:
mode:
authorStephan Merker <merker.stephan@googlemail.com>2011-10-03 17:40:09 +0200
committerStephan Merker <merker.stephan@googlemail.com>2011-10-03 17:40:09 +0200
commit4c112ed7a840c3ecc28322213e01820cec92df20 (patch)
tree6ae8d20fcf5ffe4cc5931e24c9740737a87a02b9 /tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java
parent25adf45d906fe8cf6ddeb21d66ce3ccd9fd82939 (diff)
downloadcgeo-4c112ed7a840c3ecc28322213e01820cec92df20.zip
cgeo-4c112ed7a840c3ecc28322213e01820cec92df20.tar.gz
cgeo-4c112ed7a840c3ecc28322213e01820cec92df20.tar.bz2
Refactoring: put tests into same java package as tested class
- fixes #587 - test suite and 3 tests (regex and whitespace perf tests) remain in cgeo.geocaching.test
Diffstat (limited to 'tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java')
-rw-r--r--tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java b/tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java
new file mode 100644
index 0000000..0dbeb3b
--- /dev/null
+++ b/tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java
@@ -0,0 +1,35 @@
+package cgeo.geocaching.compatibility;
+
+import cgeo.geocaching.cgeo;
+import cgeo.geocaching.compatibility.Compatibility;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+import junit.framework.Assert;
+
+@SuppressWarnings("static-method")
+public class CompatibilityTest extends ActivityInstrumentationTestCase2<cgeo> {
+
+ private cgeo activity;
+
+ public CompatibilityTest() {
+ super("cgeo.geocaching", cgeo.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ activity = getActivity();
+ }
+
+ public void testDataChanged() {
+ // This should not raise an exception in any Android version
+ Compatibility.dataChanged("cgeo.geocaching");
+ }
+
+ public void testGetDirectionNow() {
+ final float angle = Compatibility.getDirectionNow(1.0f, activity);
+ Assert.assertTrue(angle == 1.0f || angle == 91.0f || angle == 181.0f || angle == 271.0f);
+ }
+
+}