Initial commit

This commit is contained in:
2023-07-02 15:26:53 +01:00
committed by GitHub
commit 16ca35eb45
42 changed files with 4536 additions and 0 deletions

24
main_test.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"football_api/general"
"github.com/stretchr/testify/require"
"net/http"
"testing"
)
func TestHealth(t *testing.T) {
s := CreateServer(nil)
// Create a New Request
req, _ := http.NewRequest("GET", "/health", nil)
// Execute Request
response := general.ExecuteRequest(req, s)
// Check the response code
general.CheckResponseCode(t, http.StatusOK, response.Code)
// We can use testify/require to assert values, as it is more convenient
require.Equal(t, "\"OK\"", response.Body.String())
}