generated from Learning-Is-Vital-In-Development/study-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: LottoTicketGenerator's generate method
- Loading branch information
Showing
1 changed file
with
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package model.lotto | ||
|
||
import io.kotest.core.spec.style.FreeSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class LottoTicketGeneratorTest : FreeSpec( | ||
{ | ||
"LottoTicketGenerator 생성" - { | ||
"일정 수의 티켓 생성" { | ||
val count = 5 | ||
val tickets = LottoTicketGenerator.generate(count) | ||
|
||
tickets.size shouldBe count | ||
} | ||
|
||
"수동 티켓 생성" { | ||
val manualNumbers = listOf( | ||
Check failure on line 17 in src/test/kotlin/model/lotto/LottoTicketGeneratorTest.kt GitHub Actions / Check Code Quality
|
||
LottoNumbers.from(listOf(1, 2, 3, 4, 5, 6)), | ||
LottoNumbers.from(listOf(7, 8, 9, 10, 11, 12)), | ||
) | ||
val tickets = LottoTicketGenerator.generate(manualNumbers) | ||
|
||
tickets.size shouldBe manualNumbers.size | ||
|
||
tickets.forEach { it.type shouldBe TicketType.Manual } | ||
} | ||
} | ||
}, | ||
) |