Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TestCase ¶
type TestCase struct {
TestName string // name of the test, eg: GET Person
TestDetail string // case which is being tested, eg: Person with invalid DOB
Route string // Route, eg: /Person
Method string // HTTP method, eg: POST
HandlerFunc func(w http.ResponseWriter, r *http.Request) // handler function
StatusCode int // expected return status code
AvoidKey []string // Keys with dynamic values like token or timestamp, eg: ["token"]
RequestHeader map[string]string // HTTP request header in key value pair map
RequestMap map[string]interface{} // Request data that can be marshaled into json
ResponseHeader map[string]string // HTTP response header in key value pair
ResponseMap map[string]interface{} // Response map that is unmarshaled from a json
TypeCheck map[string]interface{} // Values for type check, only the types of values are compared. For testing values like token
RequestContextKey interface{} // Key value for context if request has context with values. Context can be used to test controllers where request already has a value
RequestContextValue interface{} // Value for context
}
TestCase Create a test case by creating instance of this struct. This structure is currently based on only json requests and responses
Click to show internal directories.
Click to hide internal directories.