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