Identify hero results by seat
This commit is contained in:
@@ -43,7 +43,7 @@ class HandSummaryTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `hero win and uncontested pot are explicit`() {
|
||||
fun `hero is identified by seat when the player uses a custom name`() {
|
||||
val summary = handSummaryFor(
|
||||
handNumber = 3,
|
||||
result = result(
|
||||
@@ -52,15 +52,16 @@ class HandSummaryTest {
|
||||
showdown = false,
|
||||
pot = 6,
|
||||
),
|
||||
seatNames = listOf("You", "Ada", "Bruno"),
|
||||
seatNames = listOf("Jay", "Ada", "Bruno"),
|
||||
)
|
||||
|
||||
assertEquals("You win", summary.title)
|
||||
assertTrue(summary.heroWon)
|
||||
assertEquals("Uncontested • Pot 6 • You won 5", summary.detail)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `several side-pot winners are not described as one split pot`() {
|
||||
fun `custom-named hero is labelled as you among several winners`() {
|
||||
val summary = handSummaryFor(
|
||||
handNumber = 9,
|
||||
result = result(
|
||||
@@ -68,17 +69,25 @@ class HandSummaryTest {
|
||||
winners = listOf(0, 1),
|
||||
pot = 40,
|
||||
),
|
||||
seatNames = listOf("You", "Ada", "Bruno"),
|
||||
seatNames = listOf("Jay", "Ada", "Bruno"),
|
||||
)
|
||||
|
||||
assertEquals("You & Ada win", summary.title)
|
||||
assertTrue(summary.heroWon)
|
||||
assertTrue(summary.detail.endsWith("You broke even"))
|
||||
}
|
||||
}
|
||||
|
||||
class VisibleHandSummaryTest {
|
||||
|
||||
private val summary = HandSummary(4, listOf("Ada"), 20, -4, true)
|
||||
private val summary = HandSummary(
|
||||
handNumber = 4,
|
||||
winnerLabels = listOf("Ada"),
|
||||
heroWon = false,
|
||||
potSize = 20,
|
||||
heroNet = -4,
|
||||
wentToShowdown = true,
|
||||
)
|
||||
|
||||
private fun snapshot(
|
||||
handNumber: Int = 4,
|
||||
|
||||
Reference in New Issue
Block a user