|
||||||||||
| 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 | |
|---|---|
java.lang.String |
createReport(java.lang.Object testObject,
java.util.List<ObservedInvocation> observedInvocations)
Creates a string representation of the given scenario. |
protected java.lang.String |
getFieldName(java.lang.Object testObject,
java.lang.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 java.lang.String |
getSuggestedArgument(java.lang.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 java.lang.String |
getSuggestedAssertStatement(java.lang.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 java.lang.String createReport(java.lang.Object testObject,
java.util.List<ObservedInvocation> observedInvocations)
testObject - scenario - The sceneario, not null
protected java.lang.String getSuggestedAssertStatement(java.lang.Object testObject,
ObservedInvocation observedInvocation)
testObject - The test instance, null if there is no test objectobservedInvocation - The invocation, not null
protected java.lang.String getSuggestedArgument(java.lang.Object argument)
argument - The actual argument value, not null
protected java.lang.String getFieldName(java.lang.Object testObject,
java.lang.Object value)
testObject - The test instance, null if there is no test objectvalue - The value to look for, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||