aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scala/xyz/driver/core/database/DatabaseTest.scala10
1 files changed, 10 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
index bd72b68..f85dcad 100644
--- a/src/test/scala/xyz/driver/core/database/DatabaseTest.scala
+++ b/src/test/scala/xyz/driver/core/database/DatabaseTest.scala
@@ -23,11 +23,21 @@ class DatabaseTest extends FlatSpec with Matchers with Checkers {
def mapper(s: String): Option[String] = if (s.length == validLength) Some(s) else None
TestConverter.fromStringOrThrow(valid, mapper, valid) should be(valid)
+
TestConverter.expectValid(mapper, valid) should be(valid)
+
TestConverter.expectExistsAndValid(mapper, validOp) should be(valid)
+ TestConverter.expectValidOrEmpty(mapper, validOp) should be(Some(valid))
+ TestConverter.expectValidOrEmpty(mapper, None) should be(None)
+
an[DatabaseException] should be thrownBy TestConverter.fromStringOrThrow(invalid, mapper, invalid)
+
+ an[DatabaseException] should be thrownBy TestConverter.expectValid(mapper, invalid)
+
an[DatabaseException] should be thrownBy TestConverter.expectExistsAndValid(mapper, invalidOp)
+
+ an[DatabaseException] should be thrownBy TestConverter.expectValidOrEmpty(mapper, invalidOp)
}
}