aboutsummaryrefslogtreecommitdiff
path: root/go/game/state_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/state_test.go')
-rw-r--r--go/game/state_test.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/go/game/state_test.go b/go/game/state_test.go
index 6a9d6eb8..f770e7fa 100644
--- a/go/game/state_test.go
+++ b/go/game/state_test.go
@@ -4,16 +4,24 @@ import (
"testing"
)
-func TestDeclareActions(t *testing.T) {
+// newMockState creates a new LocalState with an empty 2x2 map and two players.
+// The players "p" and "o" are initialized with mock player controls.
+func newMockState() (*LocalState, *Map, *Player, *Player) {
s := NewLocalState()
m := newEmpty2x2Map()
s.SetMap(m)
p := s.AddNewPlayer("p", NewDeck())
- p.Store.AddCard(NewCard("base/sword"))
p.Ctrl = newMockPlayerControl(p)
+
o := s.AddNewPlayer("o", NewDeck())
o.Ctrl = newMockPlayerControl(o)
+ return s, m, p, o
+}
+
+func TestDeclareActions(t *testing.T) {
+ s, m, p, o := newMockState()
+ p.Store.AddCard(NewCard("base/sword"))
a := s.addNewUnit(NewCard("base/archer"), Position{0, 0}, p)
k := s.addNewUnit(NewCard("base/knight"), Position{1, 1}, o)