Upgrade and add new testing functions
This commit is contained in:
parent
d12679df65
commit
9330ed8e74
13 changed files with 1867 additions and 130 deletions
|
|
@ -66,6 +66,20 @@ func TestDeleteRequest(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestPatchRequest(t *testing.T) {
|
||||
r := NewRouter()
|
||||
handler := Controller(func(c *Context) *Response {
|
||||
c.GetLogger().Info(TEST_STR)
|
||||
return nil
|
||||
})
|
||||
r.Patch("/", handler)
|
||||
|
||||
route := r.GetRoutes()[0]
|
||||
if route.Method != "patch" || route.Path != "/" {
|
||||
t.Errorf("failed adding route with patch http method")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPutRequest(t *testing.T) {
|
||||
r := NewRouter()
|
||||
handler := Controller(func(c *Context) *Response {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue