Fix function name and interface tests.

This commit is contained in:
Brad Van Vugt 2020-05-17 14:38:39 -07:00
parent fe2a415cac
commit 68043109a5
4 changed files with 13 additions and 1 deletions

View file

@ -35,5 +35,5 @@ type SnakeMove struct {
type Ruleset interface {
CreateInitialBoardState(width int32, height int32, snakeIDs []string) (*BoardState, error)
CreateNextBoardState(prevState *BoardState, moves []SnakeMove) (*BoardState, error)
IsGameFinished(state *BoardState) (bool, error)
IsGameOver(state *BoardState) (bool, error)
}

View file

@ -6,6 +6,10 @@ import (
"github.com/stretchr/testify/require"
)
func TestSoloRulesetInterface(t *testing.T) {
var _ Ruleset = (*SoloRuleset)(nil)
}
func TestSoloCreateNextBoardStateSanity(t *testing.T) {
boardState := &BoardState{}
r := SoloRuleset{}

View file

@ -9,6 +9,10 @@ import (
"github.com/stretchr/testify/require"
)
func TestStandardRulesetInterface(t *testing.T) {
var _ Ruleset = (*StandardRuleset)(nil)
}
func TestSanity(t *testing.T) {
r := StandardRuleset{}

View file

@ -6,6 +6,10 @@ import (
"github.com/stretchr/testify/require"
)
func TestTeamRulesetInterface(t *testing.T) {
var _ Ruleset = (*TeamRuleset)(nil)
}
func TestCreateNextBoardStateSanity(t *testing.T) {
boardState := &BoardState{}
r := TeamRuleset{}