Documentation
¶
Index ¶
- type TestExecutor
- func (te TestExecutor) CheckBody(body []byte, storedData map[string]interface{}) []byte
- func (te TestExecutor) CheckHeader(header map[string]string, storedData map[string]interface{})
- func (te TestExecutor) Execute(req *http.Request) TestValidator
- func (te *TestExecutor) Flush()
- func (te TestExecutor) MakeRequest(method string, url string, body []byte) (*http.Request, error)
- func (te TestExecutor) SetHeader(req *http.Request, header map[string]string)
- func (te TestExecutor) SetParams(url string, params map[string]string) string
- type TestResponse
- type TestValidator
- func (tv TestValidator) ExpectBody(t *testing.T, body map[string]interface{})
- func (tv TestValidator) ExpectNotNilAndSave(t *testing.T, key string) interface{}
- func (tv TestValidator) ExpectResponseStatus(t *testing.T, status string)
- func (tv TestValidator) ExpectValueEqual(t *testing.T, expected interface{}, actual interface{})
- func (tv TestValidator) ExpectValueNotEqual(t *testing.T, expected interface{}, actual interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestExecutor ¶
type TestExecutor struct { R *gin.Engine W *httptest.ResponseRecorder }
func Initiate ¶
func Initiate() TestExecutor
func (TestExecutor) CheckBody ¶
func (te TestExecutor) CheckBody(body []byte, storedData map[string]interface{}) []byte
func (TestExecutor) CheckHeader ¶
func (te TestExecutor) CheckHeader(header map[string]string, storedData map[string]interface{})
func (TestExecutor) Execute ¶
func (te TestExecutor) Execute(req *http.Request) TestValidator
func (*TestExecutor) Flush ¶
func (te *TestExecutor) Flush()
func (TestExecutor) MakeRequest ¶
type TestResponse ¶
func (TestResponse) ParseBody ¶
func (tr TestResponse) ParseBody() (map[string]interface{}, error)
func (TestResponse) RetrieveValueFromBody ¶
func (tr TestResponse) RetrieveValueFromBody(key string, body interface{}) interface{}
type TestValidator ¶
type TestValidator struct {
Response TestResponse
}
func (TestValidator) ExpectBody ¶
func (tv TestValidator) ExpectBody(t *testing.T, body map[string]interface{})
func (TestValidator) ExpectNotNilAndSave ¶
func (tv TestValidator) ExpectNotNilAndSave(t *testing.T, key string) interface{}
func (TestValidator) ExpectResponseStatus ¶
func (tv TestValidator) ExpectResponseStatus(t *testing.T, status string)
func (TestValidator) ExpectValueEqual ¶
func (tv TestValidator) ExpectValueEqual(t *testing.T, expected interface{}, actual interface{})
func (TestValidator) ExpectValueNotEqual ¶
func (tv TestValidator) ExpectValueNotEqual(t *testing.T, expected interface{}, actual interface{})
Click to show internal directories.
Click to hide internal directories.