예제 #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)
}