Tests error response structure.
(t *testing.T)
| 56 | |
| 57 | // Tests error response structure. |
| 58 | func TestErrorResponse(t *testing.T) { |
| 59 | var err error |
| 60 | err = ErrorResponse{ |
| 61 | Code: Testing, |
| 62 | } |
| 63 | errResp := ToErrorResponse(err) |
| 64 | if errResp.Code != Testing { |
| 65 | t.Fatal("Type conversion failed, we have an empty struct.") |
| 66 | } |
| 67 | |
| 68 | // Should fail with invalid argument. |
| 69 | err = httpRespToErrorResponse(nil, "", "") |
| 70 | errResp = ToErrorResponse(err) |
| 71 | if errResp.Code != InvalidArgument { |
| 72 | t.Fatal("Empty response input should return invalid argument.") |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // Tests signature type. |
| 77 | func TestSignatureType(t *testing.T) { |
nothing calls this directly
no test coverage detected