@@ -20,13 +20,13 @@ If you have only one parameter that you want to vary, check out [How to Test a V
20
20
1 . Copy this starter text, and adjust for the number of inputs that you have.
21
21
22
22
<!-- snippet: CombinationsStartingPoint -->
23
- <a id =' snippet-combinationsstartingpoint ' ></a >
23
+ <a id =' snippet-CombinationsStartingPoint ' ></a >
24
24
``` java
25
25
String [] inputs1 = {" input1.value1" , " input1.value2" };
26
26
String [] inputs2 = {" input2.value1" , " input2.value2" , " input2.value3" };
27
27
CombinationApprovals . verifyAllCombinations((a, b) - > " placeholder" , inputs1, inputs2);
28
28
```
29
- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/CombinationTest.java#L42-L46 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-combinationsstartingpoint ' title =' Start of snippet ' >anchor</a ></sup >
29
+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/CombinationTest.java#L42-L46 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-CombinationsStartingPoint ' title =' Start of snippet ' >anchor</a ></sup >
30
30
<!-- endSnippet -->
31
31
32
32
2 . Modify each input container for your chosen values.
@@ -60,13 +60,13 @@ This makes a kind of approval test matrix, automatically testing all combination
60
60
In this small example, all combinations of ` {"hello", "world"} ` and ` {1, 2, 3} ` are being used:
61
61
62
62
<!-- snippet: YouCanVerifyCombinationsOf2 -->
63
- <a id =' snippet-youcanverifycombinationsof2 ' ></a >
63
+ <a id =' snippet-YouCanVerifyCombinationsOf2 ' ></a >
64
64
``` java
65
65
String [] strings = {" hello" , " world" };
66
66
Integer [] numbers = {1 , 2 , 3 };
67
67
CombinationApprovals . verifyAllCombinations((s, i) - > String . format(" (%s,%s)" , s, i), strings, numbers);
68
68
```
69
- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/CombinationTest.java#L51-L55 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-youcanverifycombinationsof2 ' title =' Start of snippet ' >anchor</a ></sup >
69
+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/CombinationTest.java#L51-L55 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-YouCanVerifyCombinationsOf2 ' title =' Start of snippet ' >anchor</a ></sup >
70
70
<!-- endSnippet -->
71
71
72
72
The format is carefully chosen to show both inputs and outputs, to make the test results easy to interpret. The output looks like this:
0 commit comments