RestApiv2/internal/restserver/restserver_iternal_test.go

18 lines
368 B
Go
Raw Permalink Normal View History

package restserver
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_RestServer_Hendler_Hello(t *testing.T) {
r := New(NewConfig())
rec := httptest.NewRecorder()
req, _ := http.NewRequest(http.MethodGet, "/hello", nil)
r.HandleHello().ServeHTTP(rec, req)
assert.Equal(t, rec.Body.String(), "TEsts Hello")
}