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
Post a Comment