aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-07-20 07:34:33 +0200
committerBananeweizen <bananeweizen@gmx.de>2014-07-20 07:34:33 +0200
commit8801cfcf6ab3848f11bbd5f458cb252366035d8b (patch)
tree56a8a88e9c7f0594b003d1b2905d91d81656eb31 /tests/src/cgeo/geocaching/connector
parent59201fa2f1087e76a68ade92d4f0f41a86a79e9a (diff)
downloadcgeo-8801cfcf6ab3848f11bbd5f458cb252366035d8b.zip
cgeo-8801cfcf6ab3848f11bbd5f458cb252366035d8b.tar.gz
cgeo-8801cfcf6ab3848f11bbd5f458cb252366035d8b.tar.bz2
refactoring: reduce package cycles
Diffstat (limited to 'tests/src/cgeo/geocaching/connector')
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/UncertainPropertyTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/src/cgeo/geocaching/connector/gc/UncertainPropertyTest.java b/tests/src/cgeo/geocaching/connector/gc/UncertainPropertyTest.java
new file mode 100644
index 0000000..728f78a
--- /dev/null
+++ b/tests/src/cgeo/geocaching/connector/gc/UncertainPropertyTest.java
@@ -0,0 +1,21 @@
+package cgeo.geocaching.connector.gc;
+
+import cgeo.geocaching.connector.gc.UncertainProperty;
+
+import junit.framework.TestCase;
+
+public class UncertainPropertyTest extends TestCase {
+
+ public static void testHigherCertaintyWins() throws Exception {
+ final UncertainProperty<String> prop1 = new UncertainProperty<String>("prop1", 10);
+ final UncertainProperty<String> prop2 = new UncertainProperty<String>("prop2", 20);
+ assertEquals(prop2, UncertainProperty.getMergedProperty(prop1, prop2));
+ }
+
+ public static void testAvoidNull() throws Exception {
+ final UncertainProperty<String> prop1 = new UncertainProperty<String>("prop1", 10);
+ final UncertainProperty<String> prop2 = new UncertainProperty<String>(null, 20);
+ assertEquals(prop1, UncertainProperty.getMergedProperty(prop1, prop2));
+ assertEquals(prop1, UncertainProperty.getMergedProperty(prop2, prop1));
+ }
+}