From a4c857745817092ccb9d2b12d83df74a0f2e25e5 Mon Sep 17 00:00:00 2001 From: Stewart Stewart Date: Thu, 22 Dec 2016 17:27:40 -0500 Subject: add Date#toString and Date.fromString --- src/test/scala/xyz/driver/core/CoreTest.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/scala/xyz/driver/core/CoreTest.scala') diff --git a/src/test/scala/xyz/driver/core/CoreTest.scala b/src/test/scala/xyz/driver/core/CoreTest.scala index e210887..e25bdbe 100644 --- a/src/test/scala/xyz/driver/core/CoreTest.scala +++ b/src/test/scala/xyz/driver/core/CoreTest.scala @@ -78,6 +78,16 @@ class CoreTest extends FlatSpec with Matchers with MockitoSugar { timestamp.toDate(EST) should not be timestamp.toDate(PST) } + "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)) + } + } + "Name" should "have equality and ordering working correctly" in { (Name[String]("foo") === Name[String]("foo")) should be(true) -- cgit v1.2.3