Fix function name and interface tests.
This commit is contained in:
parent
fe2a415cac
commit
68043109a5
4 changed files with 13 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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{}
|
||||
|
|
|
|||
|
|
@ -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{}
|
||||
|
||||
|
|
|
|||
|
|
@ -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{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue