27 lines
646 B
Go
27 lines
646 B
Go
package game_test
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/iliadenisov/galaxy/pkg/game"
|
|
"github.com/iliadenisov/galaxy/pkg/util"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestRelation(t *testing.T) {
|
|
root, cleanup := util.CreateWorkDir(t)
|
|
defer cleanup()
|
|
players := 20
|
|
races := make([]string, players)
|
|
for i := range players {
|
|
races[i] = fmt.Sprintf("race_%02d", i)
|
|
}
|
|
_, err := game.ComposeGame(func(p *game.Param) { p.StoragePath = root }, races)
|
|
assert.NoError(t, err)
|
|
|
|
err = game.DeclarePeace(func(p *game.Param) { p.StoragePath = root }, "race_05", "race_01")
|
|
assert.NoError(t, err)
|
|
// TODO: check relation state changed
|
|
}
|