Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there any Assert statement for checking Greater than or equal to condition?

 
Pooja Patole
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
Can anyone tell me if there is an assert in Junit api to check for greater than or equal to condition? I checked the api but did not find any such thing.. I want to check if count1 is greater than or equal to count2.. How should i do that??

Thanks ,
Pooja
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do take out time to CarefullyChooseOneForum
You have posted in the GUI forum, which has nothing to do with your question.
This post has been moved to a more appropriate forum
 
Pooja Patole
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Please do take out time to CarefullyChooseOneForum
You have posted in the GUI forum, which has nothing to do with your question.
This post has been moved to a more appropriate forum


Hello Maneesh. Where do i write this post then?
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to do anything. I have already moved it to the Testing forum for you
 
Pooja Patole
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:You don't need to do anything. I have already moved it to the Testing forum for you


OKay !! Thanks .. So I think I am in the testing forum now ..
 
dennis deems
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't a greater-than-or-equal-to assertion. You'll have to write something like this:
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use the keywordYou would do well to define the invariant for the class and put it into a methodThen at the end of each method which alters any fields, you put an assertionThen you execute the application with the -ea option
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic