(t *testing.T)
| 286 | } |
| 287 | |
| 288 | func TestHTTP(t *testing.T) { |
| 289 | err := NewMethodNotAllowed("GET") |
| 290 | if err == nil { |
| 291 | t.Fatal("New Mathod Check failed") |
| 292 | } |
| 293 | |
| 294 | err = NewBadRequest(errors.New("Bad Request")) |
| 295 | if err == nil { |
| 296 | t.Fatal("New Bad Request Check failed") |
| 297 | } |
| 298 | |
| 299 | if err.StatusCode != 400 { |
| 300 | t.Fatal("New Bad Request error code construction failed") |
| 301 | } |
| 302 | |
| 303 | err = NewBadRequestString("Bad Request String") |
| 304 | if err == nil { |
| 305 | t.Fatal("New Bad Request String Check failed") |
| 306 | } |
| 307 | |
| 308 | if err.StatusCode != 400 { |
| 309 | t.Fatal("New Bad Request String error code construction failed") |
| 310 | } |
| 311 | |
| 312 | err = NewBadRequestMissingParameter("Request Missing Parameter") |
| 313 | if err == nil { |
| 314 | t.Fatal("New Bad Request Missing Parameter Check failed") |
| 315 | } |
| 316 | |
| 317 | if err.StatusCode != 400 { |
| 318 | t.Fatal("New Bad Request Missing Parameter error code construction failed") |
| 319 | } |
| 320 | |
| 321 | err = NewBadRequestUnwantedParameter("Unwanted Parameter Present In Request") |
| 322 | if err == nil { |
| 323 | t.Fatal("New Bad Request Unwanted Parameter Check failed") |
| 324 | } |
| 325 | |
| 326 | if err.StatusCode != 400 { |
| 327 | t.Fatal("New Bad Request Unwanted Parameter error code construction failed") |
| 328 | } |
| 329 | |
| 330 | } |
| 331 | |
| 332 | func TestHTTPErrorString(t *testing.T) { |
| 333 | method := "GET" |
nothing calls this directly
no test coverage detected
searching dependent graphs…