Identify hero results by seat

This commit is contained in:
Jay
2026-07-26 14:33:03 -04:00
parent 9eb77a27a2
commit 6e0766534a
2 changed files with 25 additions and 10 deletions
@@ -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,