summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-11-13 00:20:55 +0100
committercyberta <cyberta@riseup.net>2022-11-22 01:48:38 +0100
commit3d093b82fc7e9da470aad55998fc817d975a69ef (patch)
tree0d1e5fba1fac0bc2897b1aa48b318fca290cbed1
parentd38845aedd6e7df50b5ffbb0627107a4eced95bd (diff)
add unit test to verify the required date formatting is correct
-rw-r--r--app/src/test/java/se/leap/bitmaskclient/base/utils/DateHelperTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/src/test/java/se/leap/bitmaskclient/base/utils/DateHelperTest.java b/app/src/test/java/se/leap/bitmaskclient/base/utils/DateHelperTest.java
new file mode 100644
index 00000000..c857c103
--- /dev/null
+++ b/app/src/test/java/se/leap/bitmaskclient/base/utils/DateHelperTest.java
@@ -0,0 +1,19 @@
+package se.leap.bitmaskclient.base.utils;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class DateHelperTest {
+
+ @Test
+ public void getFormattedDateWithTimezone() {
+ Pattern datePattern = Pattern.compile("^10 Nov 22 11:26 [+-][0-9]{4}$");
+ String formattedDate = DateHelper.getFormattedDateWithTimezone(1668075969744L);
+ Matcher matcher = datePattern.matcher(formattedDate);
+ assertTrue(matcher.find());
+ }
+} \ No newline at end of file