Skip to content

Commit

Permalink
Merge pull request #15 from hmrc/PLATUI-380
Browse files Browse the repository at this point in the history
PlatUI-380: Improve sample size of test data in generative testing
  • Loading branch information
omair-ali committed Feb 26, 2020
2 parents c22edce + 49d00e1 commit f55ba11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object Generators {
value <- Gen.alphaStr
} yield (attr, value)

def genAttributes(nAttributes: Int = 5) =
def genAttributes(nAttributes: Int = 15) =
for {
sz <- Gen.chooseNum(0, nAttributes)
attributes <- Gen.mapOfN[String, String](sz, genAttrVal)
Expand All @@ -54,13 +54,13 @@ object Generators {
} yield html
}

def genClasses(nClasses: Int = 3): Gen[String] =
def genClasses(nClasses: Int = 15): Gen[String] =
for {
sz <- Gen.chooseNum(0, nClasses)
classes <- Gen.listOfN(sz, Gen.alphaStr.suchThat(_.trim.nonEmpty)).map(_.mkString(" "))
} yield classes

def genClassesSeq(nClasses: Int = 3): Gen[Seq[String]] =
def genClassesSeq(nClasses: Int = 15): Gen[Seq[String]] =
for {
sz <- Gen.chooseNum(0, nClasses)
classes <- Gen.listOfN(sz, Gen.alphaStr.suchThat(_.trim.nonEmpty))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object Generators {
} yield NavigationItem(text = text, href = href, active = active, attributes = attributes)
}

def genNavigationItems(n: Int = 5): Gen[List[NavigationItem]] = for {
def genNavigationItems(n: Int = 15): Gen[List[NavigationItem]] = for {
sz <- Gen.chooseNum(0, n)
items <- Gen.listOfN[NavigationItem](sz, arbNavigationItem.arbitrary)
} yield items
Expand All @@ -44,7 +44,7 @@ object Generators {
productName <- Gen.option(genAlphaStr())
serviceName <- Gen.option(genAlphaStr())
serviceUrl <- genAlphaStr()
navigation <- Gen.option(genNavigationItems(20))
navigation <- Gen.option(genNavigationItems())
navigationClasses <- genAlphaStr()
containerClasses <- genAlphaStr()
classes <- genAlphaStr()
Expand Down

0 comments on commit f55ba11

Please sign in to comment.