Mock Private and Other Non-Public Members and Types
Mocking Non-Public Members and Types Overview
In the most complex dependency cases, JustMock’s powerful features enable you to mock private methods containing important logic that creates a critical code dependency. It also supports mocking members with any access modifier like: public, private, internal, protected, protected internal, private protected.
The supported mocking operations include: mock of non-public property getter and setter, mock of any non-public method overload, mock non-public method with argument matcher, mock non-public static members, etc.
Along the capability of mocking private methods JustMock supports argument matchers that allow you to more easily and precise narrow down for which exact arguments the created mock should execute the expected logic: