(t *testing.T)
| 462 | } |
| 463 | |
| 464 | func TestAPIResponse_IsNotFound(t *testing.T) { |
| 465 | tests := []struct { |
| 466 | code int |
| 467 | expect bool |
| 468 | }{ |
| 469 | {404, true}, |
| 470 | {200, false}, |
| 471 | {403, false}, |
| 472 | {500, false}, |
| 473 | } |
| 474 | |
| 475 | for _, tt := range tests { |
| 476 | resp := &lib.APIResponse{StatusCode: tt.code} |
| 477 | if resp.IsNotFound() != tt.expect { |
| 478 | t.Errorf("IsNotFound() for %d: expected %v", tt.code, tt.expect) |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | func TestAPIResponse_FormatJSON(t *testing.T) { |
| 484 | resp := &lib.APIResponse{ |
nothing calls this directly
no test coverage detected