diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2015-02-13 23:10:47 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2015-02-13 23:10:47 +0100 |
commit | 0b77441d721dbd444c0a4675978fecf753ad79f6 (patch) | |
tree | 281dc5950ab800412e36c23f619d09554d59c5ab /tests/src/cgeo/geocaching/connector/trackable | |
parent | 1d9a1922ca9ab563d686150ca20a153b20a378d7 (diff) | |
download | cgeo-0b77441d721dbd444c0a4675978fecf753ad79f6.zip cgeo-0b77441d721dbd444c0a4675978fecf753ad79f6.tar.gz cgeo-0b77441d721dbd444c0a4675978fecf753ad79f6.tar.bz2 |
some more connector tests
Diffstat (limited to 'tests/src/cgeo/geocaching/connector/trackable')
-rw-r--r-- | tests/src/cgeo/geocaching/connector/trackable/UnknownTrackableConnectorTest.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/connector/trackable/UnknownTrackableConnectorTest.java b/tests/src/cgeo/geocaching/connector/trackable/UnknownTrackableConnectorTest.java new file mode 100644 index 0000000..ded0a1a --- /dev/null +++ b/tests/src/cgeo/geocaching/connector/trackable/UnknownTrackableConnectorTest.java @@ -0,0 +1,44 @@ +package cgeo.geocaching.connector.trackable; + +import static org.assertj.core.api.Assertions.assertThat; + +import cgeo.geocaching.Trackable; + +import junit.framework.TestCase; + +public class UnknownTrackableConnectorTest extends TestCase { + + private static UnknownTrackableConnector getConnector() { + return new UnknownTrackableConnector(); + } + + public static void testCanHandleTrackable() throws Exception { + assertThat(getConnector().canHandleTrackable("TB1234")).isFalse(); + } + + public static void testGetUrl() throws Exception { + try { + getConnector().getUrl(new Trackable()); + fail("IllegalStateException expected"); + } catch (final IllegalStateException e) { + // empty + } + } + + public static void testSearchTrackable() throws Exception { + assertThat(getConnector().searchTrackable("TB1234", null, null)).isNull(); + } + + public static void testIsLoggable() throws Exception { + assertThat(getConnector().isLoggable()).isFalse(); + } + + public static void testGetTrackableCodeFromUrl() throws Exception { + assertThat(getConnector().getTrackableCodeFromUrl("http://www.sometrackable.com/1234")).isNull(); + } + + public static void testGetUserActions() throws Exception { + assertThat(getConnector().getUserActions()).isEmpty(); + } + +} |