Package org.jmock.lib
Class RetroNamingScheme
- java.lang.Object
-
- org.jmock.lib.RetroNamingScheme
-
- All Implemented Interfaces:
MockObjectNamingScheme
public class RetroNamingScheme extends java.lang.Object implements MockObjectNamingScheme
A naming scheme in which the implicit name for a mock object is the mocked type's name prepend with "mock". E.g. A mock object of type HelloWorld would be called "mockHelloWorld". This was the naming scheme used at Connextra and in many early examples of TDD with mock objects.- Author:
- npryce
-
-
Field Summary
Fields Modifier and Type Field Description static RetroNamingScheme
INSTANCE
-
Constructor Summary
Constructors Constructor Description RetroNamingScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
defaultNameFor(java.lang.Class<?> typeToMock)
Derive a name for a mock object from the name of the given type.
-
-
-
Field Detail
-
INSTANCE
public static final RetroNamingScheme INSTANCE
-
-
Method Detail
-
defaultNameFor
public java.lang.String defaultNameFor(java.lang.Class<?> typeToMock)
Description copied from interface:MockObjectNamingScheme
Derive a name for a mock object from the name of the given type.- Specified by:
defaultNameFor
in interfaceMockObjectNamingScheme
- Parameters:
typeToMock
- The type being mocked.- Returns:
- The default name for a mock object of the given type.
-
-