package main import ( "net/http" "net/http/httptest" "testing" "github.com/stretchr/testify/assert" ) func TestIndexRoute(t *testing.T) { t.Run("Index route returns valid response", func(t *testing.T) { request := httptest.NewRequest(http.MethodGet, "/", nil) responseRecorder := httptest.NewRecorder() IndexHandler(responseRecorder, request) assert.Equal(t, responseRecorder.Code, 200, "Response code should be 200") assert.NotNil(t, responseRecorder.Body, "Response should contain body") }) }