refactor: executors and routers
* refactor: executors and routers
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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{})
|
||||
}
|
||||
Reference in New Issue
Block a user