refactor: executors and routers
* refactor: executors and routers
This commit is contained in:
@@ -2,6 +2,7 @@ package router_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/iliadenisov/galaxy/internal/model/rest"
|
||||
"github.com/iliadenisov/galaxy/internal/router"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -63,3 +65,17 @@ func limitTestingRouter() *gin.Engine {
|
||||
})
|
||||
return r
|
||||
}
|
||||
|
||||
func generateInitRequest(races int) rest.Init {
|
||||
request := rest.Init{
|
||||
Races: make([]rest.Race, races),
|
||||
}
|
||||
for i := range request.Races {
|
||||
request.Races[i] = rest.Race{Name: raceName(i)}
|
||||
}
|
||||
return request
|
||||
}
|
||||
|
||||
func raceName(i int) string {
|
||||
return fmt.Sprintf("Race_%02d", i)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user