Skip to content

Commit

Permalink
Document constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
squarejesse committed Oct 11, 2024
1 parent 1df1952 commit 1393ab0
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ enum class Collections {
}
```

Annotate your test class to use Burst.
Annotate your test class with `@Burst`, and accept an enum as a constructor parameter:

```kotlin
@Burst
class DrinkSodaTest {
class DrinkSodaTest(
val soda: Soda,
) {
...
}
```

When you use an enum in a test function, Burst will specialize that test for each value in the enum.
Burst will specialize the test class for each value in the enum.

Burst can also specialize individual test functions:

```kotlin
@Test
Expand All @@ -59,7 +64,7 @@ fun drinkFavoriteSodas(soda: Soda) {
}
```

Combine multiple enums for the combination of their variations.
Use multiple enums for the combination of their variations.

```kotlin
@Test
Expand All @@ -70,7 +75,12 @@ fun collectSodas(soda: Soda, collectionsFactory: CollectionFactory) {

The test will be specialized for each combination of arguments.

[`Pepsi` & `MutableSetOf`, `Pepsi` & `MutableListOf`, `Pepsi` & `NewArrayDeque`, `Code` & `MutableSetOf`, ...].
* `collectSodas(Soda.Pepsi, CollectionFactory.MutableSetOf)`
* `collectSodas(Soda.Pepsi, CollectionFactory.MutableListOf)`
* `collectSodas(Soda.Pepsi, CollectionFactory.NewArrayDeque)`
* `collectSodas(Soda.Coke, CollectionFactory.MutableSetOf)`
* `collectSodas(Soda.Coke, CollectionFactory.MutableListOf)`
* `collectSodas(Soda.Coke, CollectionFactory.NewArrayDeque)`

Gradle Setup
------------
Expand Down

0 comments on commit 1393ab0

Please sign in to comment.