d9c8de27e5
* refactor: executors and routers
29 lines
640 B
Go
29 lines
640 B
Go
package router_test
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/google/uuid"
|
|
"github.com/iliadenisov/galaxy/internal/model/rest"
|
|
"github.com/iliadenisov/galaxy/internal/router"
|
|
"github.com/iliadenisov/galaxy/internal/router/handler"
|
|
)
|
|
|
|
type dummyExecutor struct {
|
|
}
|
|
|
|
func (e *dummyExecutor) Execute(cmd ...handler.Command) error {
|
|
return nil
|
|
}
|
|
|
|
func (e *dummyExecutor) GenerateGame(races []string) (uuid.UUID, error) {
|
|
return uuid.New(), nil
|
|
}
|
|
|
|
func (e *dummyExecutor) GameState() (rest.StateResponse, error) {
|
|
return rest.StateResponse{}, nil
|
|
}
|
|
|
|
func setupRouter() *gin.Engine {
|
|
return router.SetupRouter(&dummyExecutor{})
|
|
}
|