github.com/bitfinexcom/bitfinex-api-go@v0.0.0-20210608095005-9e0b26f200fb/pkg/models/fundingloan/cancel_test.go (about) 1 package fundingloan_test 2 3 import ( 4 "testing" 5 6 "github.com/bitfinexcom/bitfinex-api-go/pkg/models/fundingloan" 7 "github.com/stretchr/testify/assert" 8 "github.com/stretchr/testify/require" 9 ) 10 11 func TestCancelRequest(t *testing.T) { 12 t.Run("MarshalJSON", func(t *testing.T) { 13 flcr := fundingloan.CancelRequest{ID: 123} 14 got, err := flcr.MarshalJSON() 15 16 require.Nil(t, err) 17 18 expected := "[0, \"flc\", null, {\"id\":123}]" 19 assert.Equal(t, expected, string(got)) 20 }) 21 }