Byte-snake-engine/cli/commands/play_test.go
Rob O'Dwyer 31faba642c
Add missing ruleset params to request body and --debug-requests option (#55)
* fix sending of new params

* add royale and squad settings to requests

* add --debug-requests option

* update test for request body and add helper

Co-authored-by: Penelope Phippen <penelope@hey.com>
2021-09-07 14:58:10 -07:00

21 lines
601 B
Go

package commands
import (
"testing"
"github.com/BattlesnakeOfficial/rules"
)
func TestGetIndividualBoardStateForSnake(t *testing.T) {
s1 := rules.Snake{ID: "one", Body: []rules.Point{{X: 3, Y: 3}}}
s2 := rules.Snake{ID: "two", Body: []rules.Point{{X: 4, Y: 3}}}
state := &rules.BoardState{
Height: 11,
Width: 11,
Snakes: []rules.Snake{s1, s2},
}
snake := Battlesnake{Name: "one", URL: "", ID: "one"}
requestBody := getIndividualBoardStateForSnake(state, snake, &rules.StandardRuleset{})
rules.RequireJSONMatchesFixture(t, "testdata/snake_request_body.json", string(requestBody))
}