|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.unitils.mock.report.impl.SuggestedAssertsReport
public class SuggestedAssertsReport
A view that will return a list of suggested assert statements that one can use in a test for the given scenario.
Constructor Summary | |
---|---|
SuggestedAssertsReport()
|
Method Summary | |
---|---|
String |
createReport(Object testObject,
List<ObservedInvocation> observedInvocations)
Creates a string representation of the given invocations. |
protected String |
formatMockName(ObservedInvocation observedInvocation)
|
protected String |
getFieldName(Object testObject,
Object value)
Checks whether the given argument value is a value of a field in the test object and, if so, returns the name of that field. |
protected String |
getSuggestedArgument(Object argument)
Creates an appropriate value so that the assert statement will be able to match the given argument value that was observed in the scenario. |
protected String |
getSuggestedAssertStatement(Object testObject,
ObservedInvocation observedInvocation)
Creates an assert statement for the given method invocation and arguments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SuggestedAssertsReport()
Method Detail |
---|
public String createReport(Object testObject, List<ObservedInvocation> observedInvocations)
testObject
- The test instance, not nullobservedInvocations
- The invocations, not null
protected String getSuggestedAssertStatement(Object testObject, ObservedInvocation observedInvocation)
testObject
- The test instance, null if there is no test objectobservedInvocation
- The invocation, not null
protected String getSuggestedArgument(Object argument)
argument
- The actual argument value, not null
protected String getFieldName(Object testObject, Object value)
testObject
- The test instance, null if there is no test objectvalue
- The value to look for, not null
protected String formatMockName(ObservedInvocation observedInvocation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |