-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
. dt Adding documentation for DynamicTest
- Loading branch information
Showing
5 changed files
with
48 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<a id="top"></a> | ||
|
||
# How to Use TestFactory | ||
|
||
<!-- toc --> | ||
## Contents | ||
|
||
* [When to use Approvals::verifyAll()](#when-to-use-approvalsverifyall) | ||
* [Steps](#steps) | ||
* [Tables](#tables)<!-- endToc --> | ||
|
||
## Explanation | ||
Approvals uses the stack trace to figure out the name of the `.approved.` file. | ||
Dynamic tests require some intervention to capture this at the right time. | ||
|
||
Because of this, you will always have to use the Options when calling `verify()` as well. | ||
|
||
## Java | ||
Here is an example of how to do this in Java: | ||
snippet: java_dynamic_test | ||
|
||
## Kotlin | ||
Here is an example of how to do this in Kotlin: | ||
snippet: kotlin_dynamic_test | ||
|
||
--- | ||
|
||
[Back to User Guide](/doc/README.md#top) |
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
1 change: 1 addition & 0 deletions
1
...t/java/org/approvaltests/namer/JUnit5StackTraceNamerTest.testFactory3.test_1.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 @@ | ||
content for 1 |
1 change: 1 addition & 0 deletions
1
...t/java/org/approvaltests/namer/JUnit5StackTraceNamerTest.testFactory3.test_2.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 @@ | ||
content for 2 |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"ExcludeDirectories": [ "target" ], | ||
"Convention": "InPlaceOverwrite", | ||
"TocLevel": 5 | ||
"TocLevel": 5, | ||
"UrlsAsSnippets": ["https://raw.githubusercontent.com/approvals/Approvaltests.Kotlin.StarterProject/refs/heads/main/src/test/kotlin/com/sample/SampleTest.kt"] | ||
} |