-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example characterization test (#28)
- Loading branch information
1 parent
68a1e56
commit c102873
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.example; | ||
|
||
import org.approvaltests.combinations.CombinationApprovals; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ExampleCollaboratorTest { | ||
|
||
@Test | ||
void sum() { | ||
CombinationApprovals.verifyAllCombinations( | ||
this::doSum, | ||
new Integer[] {-1, 2, 3, 4}, | ||
new Integer[] {-1, 2, 3, 4} | ||
); | ||
} | ||
|
||
private int doSum(final Integer a, final Integer b) { | ||
final ExampleCollaborator exampleCollaborator = new ExampleCollaborator(); | ||
return exampleCollaborator.sum(a, b); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/test/java/org/example/ExampleCollaboratorTest.sum.approved.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[-1, -1] => -2 | ||
[-1, 2] => 1 | ||
[-1, 3] => 2 | ||
[-1, 4] => 3 | ||
[2, -1] => 1 | ||
[2, 2] => 4 | ||
[2, 3] => 5 | ||
[2, 4] => 6 | ||
[3, -1] => 2 | ||
[3, 2] => 5 | ||
[3, 3] => 6 | ||
[3, 4] => 7 | ||
[4, -1] => 3 | ||
[4, 2] => 6 | ||
[4, 3] => 7 | ||
[4, 4] => 8 |