- priority: 5 --> 3
Similar to my previous feature request about declarable
default actions it would be nice to be able to declare
default references in a testCase (typically setup). Reason:
Quite often you want to compare something other than
eq() about a certain type of object like this:
MyUserObjectThatDoesNotHaveAnEqualsMethod user = new
User("name");
userManager.login(user, password);
modify().args(is.same(user));
It would be nice to be able to declare default
expressions for some types of arguments like this:
default.argumentExpression.when(is.instanceOf(MyUserObjectThatDoesNotHaveAnEqualsMethod.class)).createReference(new.by.toString());
or something in that manner. This would also save
modifications.
I'm absolutely not haappy about the semantics above, i
just want to describe the principle.