Documentation
¶
Index ¶
- Constants
- type TestManager
- func (m *TestManager) Given() *given
- func (m *TestManager) Json(jsonStr string) interface{}
- func (m *TestManager) JsonFile(fileName string) interface{}
- func (m *TestManager) Then() *then
- func (m *TestManager) When() *when
- func (m *TestManager) WithDefaultErrorHandler() *TestManager
- func (m *TestManager) WithErrorHandler(errorHandler echo.HTTPErrorHandler) *TestManager
- func (m *TestManager) WithServer(server *echo.Echo) *TestManager
Constants ¶
View Source
const HeaderContentType = "Content-Type"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestManager ¶
type TestManager struct {
// contains filtered or unexported fields
}
TestManager is helper to test REST handler created with echo HTTP server
func For ¶
func For(t *testing.T) *TestManager
For builds a test manager using the provided test context T
func (*TestManager) Given ¶
func (m *TestManager) Given() *given
Given returns the GIVEN builder. It allows to define the preconditions for the test
func (*TestManager) Json ¶
func (m *TestManager) Json(jsonStr string) interface{}
Json allows to define the request or response body from JSON in a string.
func (*TestManager) JsonFile ¶
func (m *TestManager) JsonFile(fileName string) interface{}
JsonFile allows to define the request or response body from JSON in a string.
func (*TestManager) Then ¶
func (m *TestManager) Then() *then
Then returns the THEN builder. It allows to verify the expectations (post conditions) for the test
func (*TestManager) When ¶
func (m *TestManager) When() *when
When returns the WHEN builder. It allows to execute the handler under test
func (*TestManager) WithDefaultErrorHandler ¶
func (m *TestManager) WithDefaultErrorHandler() *TestManager
func (*TestManager) WithErrorHandler ¶
func (m *TestManager) WithErrorHandler(errorHandler echo.HTTPErrorHandler) *TestManager
WithErrorHandler adds to the TestManager an error handler to convert errors to HTTP codes
func (*TestManager) WithServer ¶
func (m *TestManager) WithServer(server *echo.Echo) *TestManager
Click to show internal directories.
Click to hide internal directories.