@@ -118,7 +118,6 @@ var values = map[string][]string{
118
118
func TestBindJSON (t * testing.T ) {
119
119
testBindOkay (t , strings .NewReader (userJSON ), MIMEApplicationJSON )
120
120
testBindError (t , strings .NewReader (invalidContent ), MIMEApplicationJSON )
121
- testBindSlice (t , strings .NewReader (userJSONArray ), MIMEApplicationJSON )
122
121
}
123
122
124
123
func TestBindXML (t * testing.T ) {
@@ -141,23 +140,6 @@ func TestBindForm(t *testing.T) {
141
140
assert .Error (t , err )
142
141
}
143
142
144
- func TestBindRouteParam (t * testing.T ) {
145
- e := New ()
146
- r := strings .NewReader (userJSONOnlyName )
147
- req := httptest .NewRequest (POST , "/" , r )
148
- req .Header .Set (HeaderContentType , MIMEApplicationJSON )
149
- rec := httptest .NewRecorder ()
150
- c := e .NewContext (req , rec )
151
- c .SetParamNames ("id" )
152
- c .SetParamValues ("5" )
153
- u := new (user )
154
- err := c .Bind (u )
155
- if assert .NoError (t , err ) {
156
- assert .Equal (t , 5 , u .ID )
157
- assert .Equal (t , "Jon Snow" , u .Name )
158
- }
159
- }
160
-
161
143
func TestBindQueryParams (t * testing.T ) {
162
144
e := New ()
163
145
req := httptest .NewRequest (GET , "/?id=1&name=Jon+Snow" , nil )
@@ -350,19 +332,3 @@ func testBindError(t *testing.T, r io.Reader, ctype string) {
350
332
}
351
333
}
352
334
}
353
-
354
- func testBindSlice (t * testing.T , r io.Reader , ctype string ) {
355
- e := New ()
356
- req := httptest .NewRequest (POST , "/" , r )
357
- rec := httptest .NewRecorder ()
358
- c := e .NewContext (req , rec )
359
- req .Header .Set (HeaderContentType , ctype )
360
- us := []user {}
361
- err := c .Bind (& us )
362
- if assert .NoError (t , err ) {
363
- assert .Equal (t , 1 , us [0 ].ID )
364
- assert .Equal (t , "Jon Snow" , us [0 ].Name )
365
- assert .Equal (t , 2 , us [1 ].ID )
366
- assert .Equal (t , "Arya Stark" , us [1 ].Name )
367
- }
368
- }
0 commit comments