aboutsummaryrefslogtreecommitdiff
path: root/go/game/playerControl_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/playerControl_test.go')
-rw-r--r--go/game/playerControl_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/go/game/playerControl_test.go b/go/game/playerControl_test.go
index 34f20c59..0182e30b 100644
--- a/go/game/playerControl_test.go
+++ b/go/game/playerControl_test.go
@@ -4,6 +4,31 @@ import (
"testing"
)
+type MockPlayerControl struct {
+ p *Player
+ sentNotifications []PlayerNotification
+}
+
+func newMockPlayerControl(p *Player) PlayerControl {
+ return &MockPlayerControl{p: p}
+}
+
+func (ctrl *MockPlayerControl) Close() {}
+func (ctrl *MockPlayerControl) Player() *Player { return ctrl.p }
+func (ctrl *MockPlayerControl) RecvNotification() (n PlayerNotification, err error) {
+ return
+}
+
+func (ctrl *MockPlayerControl) SendNotification(n PlayerNotification) error {
+ ctrl.sentNotifications = append(ctrl.sentNotifications, n)
+ return nil
+}
+
+func (ctrl *MockPlayerControl) RecvAction() (Action, error) {
+ return nil, nil
+}
+func (ctrl *MockPlayerControl) SendAction(Action) error { return nil }
+
const PRORITY_STRING = "!priority{}"
func TestMarshalPriority(t *testing.T) {