diff options
author | Marvin Bertin <marvin.bertin@gmail.com> | 2017-10-10 17:05:32 -0700 |
---|---|---|
committer | Marvin Bertin <marvin.bertin@gmail.com> | 2017-10-10 17:05:32 -0700 |
commit | f55212361d6126a05075a1f00f3915484b4f334e (patch) | |
tree | a376ae86b707699a971ddbd6abe6bd2d29ca124d /src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala | |
parent | 0653b90dddc294fddb0e81059aef00b202113d78 (diff) | |
download | rest-query-f55212361d6126a05075a1f00f3915484b4f334e.tar.gz rest-query-f55212361d6126a05075a1f00f3915484b4f334e.tar.bz2 rest-query-f55212361d6126a05075a1f00f3915484b4f334e.zip |
add json format tests for Slot and Eligibility arms
Diffstat (limited to 'src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala')
-rw-r--r-- | src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala | 68 |
1 files changed, 38 insertions, 30 deletions
diff --git a/src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala b/src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala index 48fc99b..609c8c8 100644 --- a/src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala +++ b/src/test/scala/xyz/driver/pdsuicommon/parsers/PaginationParserSuite.scala @@ -11,36 +11,40 @@ class PaginationParserSuite extends FreeSpecLike with MustMatchers { "parse" - { "pageSize" - { "should parse positive value" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "10", - "pageNumber" -> "1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "10", + "pageNumber" -> "1" + )) pagination must success pagination.get.pageSize mustBe 10 } "should return a default value if there is no one" in { - val pagination = PaginationParser.parse(Seq( - "pageNumber" -> "1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageNumber" -> "1" + )) pagination must success pagination.get.pageSize mustBe 100 } "should return a error for zero value" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "0", - "pageNumber" -> "1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "0", + "pageNumber" -> "1" + )) checkFailedValidationOnlyOn(pagination, "pageSize") } "should return a error for negative value" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "-10", - "pageNumber" -> "1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "-10", + "pageNumber" -> "1" + )) checkFailedValidationOnlyOn(pagination, "pageSize") } @@ -48,36 +52,40 @@ class PaginationParserSuite extends FreeSpecLike with MustMatchers { "pageNumber" - { "should parse positive value" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "1", - "pageNumber" -> "1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "1", + "pageNumber" -> "1" + )) pagination must success pagination.get.pageSize mustBe 1 } "should return a default value if there is no one" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "1" + )) pagination must success pagination.get.pageNumber mustBe 1 } "should return a error for zero value" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "1", - "pageNumber" -> "0" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "1", + "pageNumber" -> "0" + )) checkFailedValidationOnlyOn(pagination, "pageNumber") } "should return a error for negative value" in { - val pagination = PaginationParser.parse(Seq( - "pageSize" -> "1", - "pageNumber" -> "-1" - )) + val pagination = PaginationParser.parse( + Seq( + "pageSize" -> "1", + "pageNumber" -> "-1" + )) checkFailedValidationOnlyOn(pagination, "pageNumber") } |