Provides utility methods that enable access to ("de-encapsulate") otherwise non-accessible fields, methods, and constructors.
Used to record expectations on mocked types and their instances.
A context object representing the current invocation to a mocked method/constructor, to be passed as the first parameter of the corresponding delegate/mock method implementation.
A base class used in the creation of a mock-up for an external type, which is usually a class from some library or component used from the internal codebase of the system under test (SUT).
Used to record strict expectations on mocked types and their instances.
Used to verify a set of expectations on available mocked types and/or instances, against the invocations which actually occurred during the test.
Indicates a mock field or a mock parameter for which all classes extending/implementing the mocked type will also get mocked.
Indicates that the value of a mock field or mock parameter will be an isolated mocked instance, intended to be passed or injected into the code under test.
Used inside a mock-up class to indicate a mock (fake) method whose implementation will temporarily replace the implementation of a matching "real" method.
Indicates an instance field of a test class as being a mock field, or a parameter of a test method as a mock parameter; in either case, the declared type of the field/parameter is a mocked type, whose instances are mocked instances.
Indicates a class to be tested, with optional automatic instantiation and/or automatic injection of dependencies.
Expectationsclass provides an API for the record-replay model of recording expected invocations which are later replayed and implicitly verified. This API makes use of the @Mocked annotation (among others). The
Verificationsclass extends the record-replay model to a record-replay-verify model, where expectations that were not recorded can be verified explicitly after exercising the code under test (ie, after the replay phase). The
MockUp<T>generic class (where
Tis the mocked type) allows the definition of fake implementations for external classes or interfaces. For a description with examples of the Expectations API, see the "Mocking" chapter in the Tutorial. For the Mockups API, see the "Faking" chapter.