aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver
diff options
context:
space:
mode:
authorVlad Uspensky <v.uspenskiy@icloud.com>2016-12-22 15:31:56 -0800
committerGitHub <noreply@github.com>2016-12-22 15:31:56 -0800
commita9e83ef7c5452d30bb0b49ae508efb17210c49ef (patch)
tree4001bd608c33986168796bb1ed49519d4d2ff28c /src/test/scala/xyz/driver
parent9dead411fb4fb170ab2372a50ed5a61ce853499b (diff)
parenta4c857745817092ccb9d2b12d83df74a0f2e25e5 (diff)
downloaddriver-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/scala/xyz/driver')
-rw-r--r--src/test/scala/xyz/driver/core/CoreTest.scala10
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)