package Ġorg . am sh ove . k lu ent . collections Ċ Ċ import Ġorg . am sh ove . k lu ent . Person Ċ import Ġorg . am sh ove . k lu ent . should Match All With Ċ import Ġorg . am sh ove . k lu ent . should Match At Least OneOf Ċ import Ġkotlin . test . Test Ċ import Ġkotlin . test . assert Fails Ċ Ċ class ĠShould Match Predicate Should Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġpass When List Contains Something That Matches () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= ĠlistOf ( Person (" Ant on ", Ġ" Che kh ov "), ĠPerson (" Alex ander ", Ġ" Push kin "), ĠPerson (" Fy od or ", Ġ" D ost o ev sky ")) ĊĠĠĠĠĠĠĠ Ġlist . should Match At Least OneOf Ġ{ Ġit . name . startsWith (" A ") Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfail When Does nt Contains Something That Matches () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= ĠlistOf ( Person (" Ant on ", Ġ" Che kh ov "), ĠPerson (" Alex ander ", Ġ" Push kin "), ĠPerson (" Fy od or ", Ġ" D ost o ev sky ")) ĊĠĠĠĠĠĠĠ Ġassert Fails Ġ{ Ġlist . should Match At Least OneOf Ġ{ Ġit . name . startsWith (" C ") Ġ} Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġpass When List Contains All That Matches () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= ĠlistOf ( Person (" Ant on ", Ġ" Che kh ov "), ĠPerson (" Alex ander ", Ġ" Push kin "), ĠPerson (" Fy od or ", Ġ" D ost o ev sky ")) ĊĠĠĠĠĠĠĠ Ġlist . should Match All With Ġ{ Ġit . name . length Ġ> Ġ 3 Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfail When Does nt Contains All That Matches () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= ĠlistOf ( Person (" Ant on ", Ġ" Che kh ov "), ĠPerson (" Alex ander ", Ġ" Push kin "), ĠPerson (" Fy od or ", Ġ" D ost o ev sky ")) ĊĠĠĠĠĠĠĠ Ġassert Fails Ġ{ Ġlist . should Match All With Ġ{ Ġit . name . startsWith (" A ") Ġ} Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġempty List Should nt Match Anything () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= Ġempty List < Person >() ĊĠĠĠĠĠĠĠ Ġassert Fails Ġ{ Ġlist . should Match At Least OneOf Ġ{ Ġtrue Ġ} Ġ} ĊĠĠĠĠĠĠĠ Ġlist . should Match All With Ġ{ Ġtrue Ġ} ĊĠĠĠĠĠĠĠ Ġlist . should Match All With Ġ{ Ġfalse Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsupport Ch aining () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlist Ġ= ĠlistOf ( Person (" Ant on ", Ġ" Che kh ov "), ĠPerson (" Alex ander ", Ġ" Push kin "), ĠPerson (" Fy od or ", Ġ" D ost o ev sky ")) ĊĠĠĠĠĠĠĠ Ġlist ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. should Match At Least OneOf Ġ{ Ġit . name . startsWith (" A ") Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. should Match At Least OneOf Ġ{ Ġit . name . startsWith (" F ") Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. should Match All With Ġ{ Ġit . name . length Ġ> Ġ 3 Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsupport Primitives Too () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġarray : ĠInt Array Ġ= ĠarrayOf ( 1 , Ġ 2 , Ġ 3 , Ġ 4 , Ġ 5 ). to IntArray () ĊĠĠĠĠĠĠĠ Ġarray . should Match At Least OneOf Ġ{ Ġit Ġ== Ġ 3 Ġ} ĊĠĠĠĠĠĠĠ Ġarray . should Match All With Ġ{ Ġit Ġ>= Ġ 0 Ġ} ĊĠĠĠ Ġ} Ċ } ĊĊ