refactor: adjust project structure
This commit is contained in:
20
test/service/service_test.go
Normal file
20
test/service/service_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"health-go/router"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestPingRoute(t *testing.T) {
|
||||
r := router.SetupRouter()
|
||||
|
||||
w := httptest.NewRecorder()
|
||||
req, _ := http.NewRequest("GET", "/fetchHosList", nil)
|
||||
r.ServeHTTP(w, req)
|
||||
|
||||
assert.JSONEq(t, `{"code: 20"}`, w.Body.String())
|
||||
}
|
Reference in New Issue
Block a user