diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2016-12-22 15:31:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-22 15:31:56 -0800 |
commit | a9e83ef7c5452d30bb0b49ae508efb17210c49ef (patch) | |
tree | 4001bd608c33986168796bb1ed49519d4d2ff28c /src/test | |
parent | 9dead411fb4fb170ab2372a50ed5a61ce853499b (diff) | |
parent | a4c857745817092ccb9d2b12d83df74a0f2e25e5 (diff) | |
download | driver-core-a9e83ef7c5452d30bb0b49ae508efb17210c49ef.tar.gz driver-core-a9e83ef7c5452d30bb0b49ae508efb17210c49ef.tar.bz2 driver-core-a9e83ef7c5452d30bb0b49ae508efb17210c49ef.zip |
Merge pull request #14 from drivergroup/date-to-string
Add Date#toString and Date.fromString
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/scala/xyz/driver/core/CoreTest.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/core/CoreTest.scala b/src/test/scala/xyz/driver/core/CoreTest.scala index 520fe8e..775fb27 100644 --- a/src/test/scala/xyz/driver/core/CoreTest.scala +++ b/src/test/scala/xyz/driver/core/CoreTest.scala @@ -76,6 +76,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) |