From b1a7a203e9691501df5f4f65a269e957b2c68ba1 Mon Sep 17 00:00:00 2001 From: eevulution Date: Fri, 18 Sep 2020 16:12:25 +0300 Subject: [PATCH] Add test for RegexFeeder --- .../ru/tinkoff/gatling/feeders/RandomFeedersSpec.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/scala/ru/tinkoff/gatling/feeders/RandomFeedersSpec.scala b/src/test/scala/ru/tinkoff/gatling/feeders/RandomFeedersSpec.scala index 933d524..730313b 100644 --- a/src/test/scala/ru/tinkoff/gatling/feeders/RandomFeedersSpec.scala +++ b/src/test/scala/ru/tinkoff/gatling/feeders/RandomFeedersSpec.scala @@ -23,6 +23,8 @@ class RandomFeedersSpec extends AnyFlatSpec with Matchers { val uuidPattern = "([a-f0-9]{8}(-[a-f0-9]{4}){4}[a-f0-9]{8})" + val regexPattern = "[a-z0-9]{9}" + it should "create RandomDateFeeder with specified date pattern" in { forAll(rndString, positiveInt, positiveInt) { (paramName, positive, negative) => (positive > negative) ==> @@ -111,6 +113,14 @@ class RandomFeedersSpec extends AnyFlatSpec with Matchers { }.check } + it should "create RegexFeeder with specified regex pattern" in { + forAll(rndString) { (paramName) => + RegexFeeder(paramName, regexPattern) + .take(50) + .forall(r => r(paramName).matches(regexPattern)) + } + } + it should "create SequentialFeeder" in { forAll(rndString, positiveInt, positiveInt) { (paramName, start, step) => val list = SequentialFeeder(paramName, start, step).take(50).toList.flatten