diff options
Diffstat (limited to 'tests/src/cgeo')
4 files changed, 8 insertions, 15 deletions
diff --git a/tests/src/cgeo/geocaching/enumerations/CacheAttributeTest.java b/tests/src/cgeo/geocaching/enumerations/CacheAttributeTest.java index 54db279..d126c0b 100644 --- a/tests/src/cgeo/geocaching/enumerations/CacheAttributeTest.java +++ b/tests/src/cgeo/geocaching/enumerations/CacheAttributeTest.java @@ -25,7 +25,7 @@ public class CacheAttributeTest extends AndroidTestCase { public static void testGetL10n() { final CacheAttribute attribute = CacheAttribute.HIKING; - // This test is language dependend. It does not make sense to test it + // This test is language dependent. It does not make sense to test it // with every attribute. We just want to know if getL10n works // correctly assertFalse("_yes and _no must not have the same translation", @@ -37,7 +37,6 @@ public class CacheAttributeTest extends AndroidTestCase { assertTrue("Test cannot be run with this attribute", attribute.gcid >= 0); assertTrue("Test cannot be run with this attribute", attribute.ocacode >= 0); assertSame(CacheAttribute.getByRawName(attribute.rawName), attribute); - assertSame(CacheAttribute.getByGcId(attribute.gcid), attribute); assertSame(CacheAttribute.getByOcACode(attribute.ocacode), attribute); } diff --git a/tests/src/cgeo/geocaching/enumerations/LogTypeTrackableTest.java b/tests/src/cgeo/geocaching/enumerations/LogTypeTrackableTest.java index 667eefb..d6b7d33 100644 --- a/tests/src/cgeo/geocaching/enumerations/LogTypeTrackableTest.java +++ b/tests/src/cgeo/geocaching/enumerations/LogTypeTrackableTest.java @@ -1,11 +1,15 @@ package cgeo.geocaching.enumerations; +import org.apache.commons.lang3.StringUtils; + import android.test.AndroidTestCase; public class LogTypeTrackableTest extends AndroidTestCase { public static void testFindById() { - assertEquals(LogTypeTrackable.DO_NOTHING, LogTypeTrackable.findById(12345)); + for (LogTypeTrackable logTypeTrackable : LogTypeTrackable.values()) { + assertTrue(StringUtils.isNotEmpty(logTypeTrackable.getLabel())); + } } } diff --git a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java index 60766b4..ed90c45 100644 --- a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java +++ b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java @@ -86,16 +86,6 @@ public class ViewportTest extends AndroidTestCase { assertFalse(vpRef.includes(vpRef.resize(2.0))); } - public static void testExpands() { - assertEquals(vpRef, vpRef.expand(new Geopoint(0, 0))); - final Viewport vp1 = vpRef.expand(new Geopoint(-4.0, 0.0)); - assertEquals(new Geopoint(-4.0, -2.0), vp1.bottomLeft); - assertEquals(new Geopoint(3.0, 4.0), vp1.topRight); - final Viewport vp2 = vpRef.expand(new Geopoint(-10.0, 10.0)); - assertEquals(new Geopoint(-10.0, -2.0), vp2.bottomLeft); - assertEquals(new Geopoint(3.0, 10.0), vp2.topRight); - } - public static void testContaining() { assertNull(Viewport.containing(Collections.singleton((ICoordinates) null))); final Set<Geopoint> points = new HashSet<Geopoint>(); diff --git a/tests/src/cgeo/geocaching/utils/LogTemplateProviderTest.java b/tests/src/cgeo/geocaching/utils/LogTemplateProviderTest.java index 5911218..249cbb1 100644 --- a/tests/src/cgeo/geocaching/utils/LogTemplateProviderTest.java +++ b/tests/src/cgeo/geocaching/utils/LogTemplateProviderTest.java @@ -10,11 +10,11 @@ public class LogTemplateProviderTest extends TestCase { public static void testApplyTemplates() { final String noTemplates = " no templates "; - assertEquals(noTemplates, LogTemplateProvider.applyTemplates(noTemplates, new LogContext(true))); + assertEquals(noTemplates, LogTemplateProvider.applyTemplates(noTemplates, new LogContext(null, null, true))); // This test can occasionally fail if the current year changes right after the next line. final String currentYear = Integer.toString(Calendar.YEAR); - assertTrue(LogTemplateProvider.applyTemplates("[DATE]", new LogContext(true)).contains(currentYear)); + assertTrue(LogTemplateProvider.applyTemplates("[DATE]", new LogContext(null, null, true)).contains(currentYear)); } } |
