public class CombinationApprover extends Approver
Approves a function by calling it with combinations of parameters. See verifyAllCombinations(Object[],
Object[], Object[], Function3).
| Constructor and Description |
|---|
CombinationApprover() |
| Modifier and Type | Method and Description |
|---|---|
CombinationApprover |
namedArguments(java.lang.String... names)
Specifies a header naming the arguments of the function under test.
|
CombinationApprover |
reportTo(Reporter reporter)
Specifies the reporter used to report mismatches.
|
CombinationApprover |
testing(java.lang.Class<?> testClass)
Specifies the testClass to use as a folder name to store approved and received files.
|
<I1> void |
verifyAllCombinations(I1[] args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2> void |
verifyAllCombinations(I1[] args1,
I2[] args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2,I3> void |
verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2,I3,I4> |
verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2,I3,I4,I5> |
verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
I5[] args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1> void |
verifyAllCombinations(java.lang.Iterable<I1> args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2> void |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2,I3> void |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2,I3,I4> |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
<I1,I2,I3,I4,I5> |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
java.lang.Iterable<I5> args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
Approver.verify(Object) for details). |
CombinationApprover |
writeTo(java.lang.String customFileName)
Specifies the name to use for approved and received files.
|
public CombinationApprover reportTo(Reporter reporter)
Specifies the reporter used to report mismatches.
public CombinationApprover writeTo(java.lang.String customFileName)
Specifies the name to use for approved and received files.
public CombinationApprover testing(java.lang.Class<?> testClass)
Specifies the testClass to use as a folder name to store approved and received files.
public CombinationApprover namedArguments(java.lang.String... names)
Specifies a header naming the arguments of the function under test. This header prefixes the approved and received CSV files.
names - one name for each argumentCombinationApproverpublic <I1> void verifyAllCombinations(java.lang.Iterable<I1> args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1 specified in the Iterable. Then the results are stored, one line for each value, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1> void verifyAllCombinations(I1[] args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1 specified in the array. Then the results are stored, one line for each value, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1 and args2 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2> void verifyAllCombinations(I1[] args1,
I2[] args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1 and args2 specified in the arrayss. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2,I3> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1, args2 and args3 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2,I3> void verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1, args2 and args3 specified in the arrays. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2,I3,I4> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3 and args4 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2,I3,I4> void verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3 and args4 specified in the arrays. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2,I3,I4,I5> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
java.lang.Iterable<I5> args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3, args4 and args5 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyargs5 - all values for the fifth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic <I1,I2,I3,I4,I5> void verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
I5[] args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see Approver.verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3, args4 and args5 specified in the arrays. Then the results are stored, one line for each combination, in a String, which is used as in the standard Approver.verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyargs5 - all values for the fifth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedCopyright © 2018 Write Them First!. All rights reserved.