@@ -20,13 +20,13 @@ If you have only one parameter that you want to vary, check out [How to Test a V
20201 . Copy this starter text, and adjust for the number of inputs that you have.
2121
2222<!-- snippet: CombinationsStartingPoint -->
23- <a id =' snippet-combinationsstartingpoint ' ></a >
23+ <a id =' snippet-CombinationsStartingPoint ' ></a >
2424``` java
2525String [] inputs1 = {" input1.value1" , " input1.value2" };
2626String [] inputs2 = {" input2.value1" , " input2.value2" , " input2.value3" };
2727CombinationApprovals . verifyAllCombinations((a, b) - > " placeholder" , inputs1, inputs2);
2828```
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 >
3030<!-- endSnippet -->
3131
32322 . Modify each input container for your chosen values.
@@ -60,13 +60,13 @@ This makes a kind of approval test matrix, automatically testing all combination
6060In this small example, all combinations of ` {"hello", "world"} ` and ` {1, 2, 3} ` are being used:
6161
6262<!-- snippet: YouCanVerifyCombinationsOf2 -->
63- <a id =' snippet-youcanverifycombinationsof2 ' ></a >
63+ <a id =' snippet-YouCanVerifyCombinationsOf2 ' ></a >
6464``` java
6565String [] strings = {" hello" , " world" };
6666Integer [] numbers = {1 , 2 , 3 };
6767CombinationApprovals . verifyAllCombinations((s, i) - > String . format(" (%s,%s)" , s, i), strings, numbers);
6868```
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 >
7070<!-- endSnippet -->
7171
7272The 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