Skip to content

How to compare things via a comparator? #1261

Answered by robstoll
SerVB asked this question in Q&A
Discussion options

You must be logged in to vote

Atrium does not provide any function involving Comparator so far, but that can change of course :)

Right now you could do (without writting an additional extension method):

expect(person.firstName)
  .feature("compare against Sergei using myLowerCaseComparator") { myLowerCaseComparator(this, "Sergei") }
  .toEqual(0)

So a few questions, what is your exact use case? something like:

  1. expect(person.firstName)  // compare it somehow against "Sergei" using myLowerCaseComparator and the result should be 0
    
  2. Would you like to use your comparator as well to compare elements in Ierables as well.
  3. Are you only interested in the 0 outcome or would you also like to expect on < 0 or > 0 ?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SerVB
Comment options

@robstoll
Comment options

Answer selected by robstoll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants