blob: 1d5ef5c045af038f62707dcd64cfd32801ae835d (
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
34
35
|
package cgeo.geocaching.test;
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);
}
}
|