aboutsummaryrefslogtreecommitdiff
path: root/internal/validate/casino_test.go
blob: 9eb94dbfc19b5528d01f8d2bd16180129570befc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package validate

import (
	"path/filepath"
	"testing"
)

func TestRoomCasinoValidation(t *testing.T) {
	dir := t.TempDir()
	writeFile(t, filepath.Join(dir, "rooms", "1.yaml"), `name: Casino
casino_tables:
  - id: cards
    game: blackjack
    min_bet: 10
    max_bet: 5
casino_machines:
  - id: slots
    game: slots
    payout: .nan
  - id: slots
    game: slots
`)
	issues := validateRooms(newSource(dir))
	for _, message := range []string{"Room 1", "max_bet", "payout", "duplicate casino id"} {
		if !containsMsg(issues, message) {
			t.Errorf("missing %q in %+v", message, issues)
		}
	}
}