aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/manager_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-30 05:33:45 -0400
committerhistoria <[not public]>2026-09-30 05:33:45 -0400
commit0fcb03633e3008169173d76c8408f5410592b3eb (patch)
tree814797fb33a129b1c49f8ae309c6647027f5e528 /internal/casino/manager_test.go
parent735428f0667f67c12fdf3caca872d7dc65e2ce26 (diff)
downloadthehouseoficarus-0fcb03633e3008169173d76c8408f5410592b3eb.tar.gz
feat: bank craps added to casino
Diffstat (limited to 'internal/casino/manager_test.go')
-rw-r--r--internal/casino/manager_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/casino/manager_test.go b/internal/casino/manager_test.go
index a832d53..43bd67f 100644
--- a/internal/casino/manager_test.go
+++ b/internal/casino/manager_test.go
@@ -1,10 +1,14 @@
package casino
-import "testing"
+import (
+ "fmt"
+ "testing"
+)
type testWallet struct {
chips, credits, paid int
open []Wager
+ seq int
}
func (w *testWallet) Wager(amount int) (Wager, error) {
@@ -18,7 +22,8 @@ func (w *testWallet) Wager(amount int) (Wager, error) {
w.chips -= chips
credits := amount - chips
w.credits -= credits
- wager := Wager{Total: amount, Chips: chips, Credits: credits, ID: string(rune('a' + len(w.open)))}
+ w.seq++
+ wager := Wager{Total: amount, Chips: chips, Credits: credits, ID: fmt.Sprintf("stake-%02d", w.seq)}
w.open = append(w.open, wager)
return wager, nil
}