dart-archive / mock

A library for mocking classes - DEPRECATED
https://pub.dartlang.org/packages/mock
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

pkg/mock should integrate with Invocation/Symbol #2

Open DartBot opened 9 years ago

DartBot commented 9 years ago

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);

DartBot commented 9 years ago

Comment by dgrove


Added Area-UnitTest, Triaged labels.

DartBot commented 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.

DartBot commented 9 years ago

Comment by kevmoo


Removed Area-UnitTest label. Added Area-Pkg, Pkg-Unittest labels.

DartBot commented 9 years ago

Comment by kevmoo


Removed Pkg-Unittest label. Added Pkg-mock label.

DartBot commented 9 years ago

Comment by kevmoo


Removed Type-Defect label. Added Type-Enhancement label. Changed the title to: "pkg/mock should integrate with Invocation/Symbol".