Open DartBot opened 9 years ago
This comment was originally written by cvl.c...@gmail.com
I'm stuck with my unittesting to the point, where I have to check the named arguments passed to a mock. I can't find a workaround, so I hope this issue is gonna be addressed soon.
Comment by kevmoo
Removed Type-Defect label. Added Type-Enhancement label. Changed the title to: "pkg/mock should integrate with Invocation/Symbol".
Issue by seaneagan Originally opened as dart-lang/sdk#14725
In LogEntry:
String methodName; List arguments;
should be replaced with
Invocation invocation;
And the CallMatcher concept should be replaced with true Matchers against Invocations.
That way named arguments are supported, and less concepts and API surface are needed.
Then callsTo could support a Symbol as the member name, and could be implemented itself with noSuchMethod, allowing to use named arguments as well:
callsTo(#foo, new isInstanceOf<String>(), someNamedArg: isNotNull);
which would match calls like:
mock.foo('a String', someNamedArg: notNull);