java - Junit tets case for different values return from method every time when i execute and need to compare with enum values -




my method returns different values when ever execute example returns abc 1st execution , cde 2nd execution want assertequla values enum values plz tell me how write junit test case.enum isabc("abc"),cde("cde");. sample junit tets case

@test  public void test() {     assertequals(enum.abc,mymethod.getvalue()); } 

to asserteqauls enum, use tostring() method:

@test  public void test() {    assertequals(enum.abc.tostring(), mymethod.getvalue()); } 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -