aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/core/database/DatabaseTest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/xyz/driver/core/database/DatabaseTest.scala')
-rw-r--r--src/test/scala/xyz/driver/core/database/DatabaseTest.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/core/database/DatabaseTest.scala b/src/test/scala/xyz/driver/core/database/DatabaseTest.scala
new file mode 100644
index 0000000..dafcd80
--- /dev/null
+++ b/src/test/scala/xyz/driver/core/database/DatabaseTest.scala
@@ -0,0 +1,14 @@
+package xyz.driver.core.database
+
+import org.scalatest.{FlatSpec, Matchers}
+import org.scalatest.prop.Checkers
+
+class DatabaseTest extends FlatSpec with Matchers with Checkers {
+ "Date SQL converter" should "correctly convert back and forth to SQL dates" in {
+ import xyz.driver.core.generators.nextDate
+
+ for (date <- 1 to 100 map (_ => nextDate())) {
+ sqlDateToDate(dateToSqlDate(date)) should be(date)
+ }
+ }
+}