func New(id string) *Pairing { game := game.New() return &Pairing{ Game: game, Parser: parser.New(game), Id: id, } }
func TestParseNextTurn(t *testing.T) { game := game.New() parser := MessageParser{game: game} parser.Parse("nextturn") assert.Equal(t, game.ActivePlayer.Role, player.RUNNER) }
func TestParseRemoveCorpCredit(t *testing.T) { game := game.New() parser := MessageParser{game: game} parser.Parse("removecorpcredit") assert.Equal(t, game.CorpCredits, 4) }
func TestParseAddCorpCredit(t *testing.T) { game := game.New() parser := MessageParser{game: game} parser.Parse("addcorpcredit") assert.Equal(t, game.CorpCredits, 6) }
func TestParseAddRunnerCredit(t *testing.T) { game := game.New() parser := MessageParser{game: game} parser.Parse("addrunnercredit") assert.Equal(t, game.RunnerCredits, 6) }
func TestParseClick(t *testing.T) { game := game.New() parser := MessageParser{game: game} parser.Parse("click") assert.Equal(t, game.Clicks, 1) }