aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-10-19 10:59:29 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-10-19 10:59:29 +0200
commit898456bcf181714d9dfaff12f9c37dce74b4ea1c (patch)
treef04cf56a38441c174f51ac75e487ffba1cc77cd3 /tests
parent2093ea462db4d8e56282de5871c58579a023d7cf (diff)
downloadcgeo-898456bcf181714d9dfaff12f9c37dce74b4ea1c.zip
cgeo-898456bcf181714d9dfaff12f9c37dce74b4ea1c.tar.gz
cgeo-898456bcf181714d9dfaff12f9c37dce74b4ea1c.tar.bz2
fix #3368: New placeholer [LOG] for twitter template
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/twitter/TwitterTest.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/src/cgeo/geocaching/twitter/TwitterTest.java b/tests/src/cgeo/geocaching/twitter/TwitterTest.java
index f8a4f85..92bda71 100644
--- a/tests/src/cgeo/geocaching/twitter/TwitterTest.java
+++ b/tests/src/cgeo/geocaching/twitter/TwitterTest.java
@@ -1,7 +1,9 @@
package cgeo.geocaching.twitter;
import cgeo.geocaching.Geocache;
+import cgeo.geocaching.LogEntry;
import cgeo.geocaching.Trackable;
+import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.settings.Settings;
import cgeo.geocaching.settings.TestSettings;
@@ -29,7 +31,19 @@ public class TwitterTest extends TestCase {
Geocache cache = new Geocache();
cache.setGeocode("GC1234");
cache.setName("TwitterTest");
- assertEquals("I found TwitterTest (http://coord.info/GC1234). #cgeo #geocaching", Twitter.getStatusMessage(cache));
+ assertEquals("I found TwitterTest (http://coord.info/GC1234). #cgeo #geocaching", Twitter.getStatusMessage(cache, null));
+ } finally {
+ TestSettings.setCacheTwitterMessage(oldMessage);
+ }
+ }
+
+ public static void testCacheMessageWithLogContent() {
+ final String oldMessage = Settings.getCacheTwitterMessage();
+ try {
+ TestSettings.setCacheTwitterMessage("[LOG]");
+ Geocache cache = new Geocache();
+ LogEntry log = new LogEntry("me", 0, LogType.FOUND_IT, "log text");
+ assertEquals("log text #cgeo #geocaching", Twitter.getStatusMessage(cache, log));
} finally {
TestSettings.setCacheTwitterMessage(oldMessage);
}
@@ -38,11 +52,11 @@ public class TwitterTest extends TestCase {
public static void testAvoidDuplicateTags() {
final String oldMessage = Settings.getCacheTwitterMessage();
try {
- TestSettings.setCacheTwitterMessage("[NAME] #cgeo");
+ TestSettings.setCacheTwitterMessage("[NAME] #cgeo #mytag");
Geocache cache = new Geocache();
cache.setGeocode("GC1234");
cache.setName("TwitterTest");
- assertEquals("TwitterTest #cgeo #geocaching", Twitter.getStatusMessage(cache));
+ assertEquals("TwitterTest #cgeo #mytag #geocaching", Twitter.getStatusMessage(cache, null));
} finally {
TestSettings.setCacheTwitterMessage(oldMessage);
}