aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/core/DateTest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/xyz/driver/core/DateTest.scala')
-rw-r--r--src/test/scala/xyz/driver/core/DateTest.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/core/DateTest.scala b/src/test/scala/xyz/driver/core/DateTest.scala
index 50f8521..dc9bca3 100644
--- a/src/test/scala/xyz/driver/core/DateTest.scala
+++ b/src/test/scala/xyz/driver/core/DateTest.scala
@@ -13,6 +13,16 @@ class DateTest extends FlatSpec with Matchers with Checkers {
} yield Date(year, date.tagMonth(month), day)
implicit val arbitraryDate = Arbitrary[Date](dateGenerator)
+ "Date" should "correctly convert to and from String" in {
+
+ import xyz.driver.core.generators.nextDate
+ import date._
+
+ for (date <- 1 to 100 map (_ => nextDate())) {
+ Some(date) should be(Date.fromString(date.toString))
+ }
+ }
+
it should "have ordering defined correctly" in {
Seq(Date.fromString("2013-05-10"),
Date.fromString("2020-02-15"),