github.com/bitfinexcom/bitfinex-api-go@v0.0.0-20210608095005-9e0b26f200fb/pkg/models/fundingoffer/cancel_test.go (about) 1 package fundingoffer_test 2 3 import ( 4 "testing" 5 6 "github.com/bitfinexcom/bitfinex-api-go/pkg/models/fundingoffer" 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 focr := fundingoffer.CancelRequest{ID: 123} 14 15 got, err := focr.MarshalJSON() 16 require.Nil(t, err) 17 18 expected := "[0, \"foc\", null, {\"id\":123}]" 19 assert.Equal(t, expected, string(got)) 20 }) 21 }