version_test.go 364 B

1234567891011121314151617181920
  1. package test
  2. import (
  3. "net/http"
  4. "testing"
  5. )
  6. func TestVersion(t *testing.T) {
  7. Init()
  8. defer Destroy()
  9. versionResponse := &struct {
  10. Version string `json:"version"`
  11. }{}
  12. NewToolKit(t).SetJsonResponse(versionResponse).
  13. Request("/example/api/version", http.MethodGet).
  14. AssertStatusCode(http.StatusOK).
  15. AssertEqual(versionResponse.Version, "v1.0.0")
  16. }