aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/compatibility/CompatibilityTest.java
blob: cd70ffb9745c7fb1e208c79121e3214361da0016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cgeo.geocaching.compatibility;

import cgeo.geocaching.MainActivity;

import android.test.ActivityInstrumentationTestCase2;

import junit.framework.Assert;

public class CompatibilityTest extends ActivityInstrumentationTestCase2<MainActivity> {

    private MainActivity activity;

    public CompatibilityTest() {
        super("cgeo.geocaching", MainActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        activity = getActivity();
    }

    public static 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);
    }

}