1234567891011121314151617181920 |
- package test
- import (
- "net/http"
- "testing"
- )
- func TestVersion(t *testing.T) {
- Init()
- defer Destroy()
- versionResponse := &struct {
- Version string `json:"version"`
- }{}
- NewToolKit(t).SetJsonResponse(versionResponse).
- Request("/example/api/version", http.MethodGet).
- AssertStatusCode(http.StatusOK).
- AssertEqual(versionResponse.Version, "v1.0.0")
- }
|