Skip to content

Commit

Permalink
Add test for RegexFeeder
Browse files Browse the repository at this point in the history
  • Loading branch information
eevulution committed Sep 18, 2020
1 parent c288467 commit 4908ef4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/scala/ru/tinkoff/gatling/feeders/RandomFeedersSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) ==>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4908ef4

Please sign in to comment.