(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestToJsonReq_Fail(t *testing.T) { |
| 43 | // Payload with unsupported data type |
| 44 | payload := map[string]interface{}{ |
| 45 | "key": make(chan int), // invalid data type for JSON encoding |
| 46 | } |
| 47 | |
| 48 | reqBuffer, err := request.ToJsonReq(payload) |
| 49 | assert.Error(t, err) |
| 50 | assert.Nil(t, reqBuffer) |
| 51 | } |
| 52 | |
| 53 | func TestCall_Success(t *testing.T) { |
| 54 | // Mock server to return a dummy response |