Mock
public class Mock
Constructor Summary | |
---|---|
Mock() Factory for mock object classes. |
Method Summary | |
---|---|
static void | generate(string class, string mock_class, array methods) Clones a class' interface and creates a mock version that can have return values and expectations set. |
static void | generatePartial(string class, string mock_class, array methods) Generates a version of a class with selected methods mocked only. |
static string | getExpectationLine(string format, array stack) Uses a stack trace to find the line of an assertion. |
public Mock()
Factory for mock object classes.
public static void generate(string class, string mock_class, array methods)
Clones a class' interface and creates a mock version that can have return values and expectations set.
public static void generatePartial(string class, string mock_class, array methods)
Generates a version of a class with selected methods mocked only. Inherits the old class and chains the mock methods of an aggregated mock object.
public static string getExpectationLine(string format, array stack)
Uses a stack trace to find the line of an assertion.
Static methods only service class for code generation of mock objects.