A flexible test may want to ignore invocations of trivial methods, like
getters and read only functions. Such methods may be called any number
of times, including none.
Currently FakeIt has no way to discard the invocations of a sequence of
methods. Using ClearInvocationHistory would discard all the methods,
trivial or not.
This new verification specifier, Any, marks a method or sequence
of methods as verified, regardless of the number of invocations
(including none).
Coverage increased (+6.0e-05%) to 99.924% when pulling 53beb4c2cfa6b59a35d08f42b895e6142b879582 on oriolarcas:master into 814f28cd509ef2a8cdf7fe370bd9ec6d3b181dc7 on eranpeer:master.
A flexible test may want to ignore invocations of trivial methods, like getters and read only functions. Such methods may be called any number of times, including none.
Currently FakeIt has no way to discard the invocations of a sequence of methods. Using
ClearInvocationHistory
would discard all the methods, trivial or not.This new verification specifier,
Any
, marks a method or sequence of methods as verified, regardless of the number of invocations (including none).Example:
Using this modifier, a flexible test may white-list the trivial methods, and make sure that important methods are not called.