rpc_request_test.go 586 B

1234567891011121314151617181920212223
  1. package requests
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func Test_RpcRequest(t *testing.T) {
  7. r := &RpcRequest{}
  8. r.InitWithApiInfo("product", "version", "action", "serviceCode", "endpointType")
  9. assert.NotNil(t, r)
  10. assert.Equal(t, "POST", r.GetMethod())
  11. assert.Equal(t, "RPC", r.GetStyle())
  12. assert.Equal(t, "product", r.GetProduct())
  13. assert.Equal(t, "version", r.GetVersion())
  14. assert.Equal(t, "action", r.GetActionName())
  15. assert.Equal(t, "serviceCode", r.GetLocationServiceCode())
  16. assert.Equal(t, "endpointType", r.GetLocationEndpointType())
  17. // url
  18. }