frostfs-api-go-pogpp/v2/accounting/json_test.go
Leonard Lyubich 9bebc1247d [#168] accounting: Implement binary/JSON encoders/decoders on Decimal
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-13 18:07:26 +03:00

20 lines
362 B
Go

package accounting_test
import (
"testing"
"github.com/nspcc-dev/neofs-api-go/v2/accounting"
"github.com/stretchr/testify/require"
)
func TestDecimalJSON(t *testing.T) {
i := generateDecimal(10)
data, err := i.MarshalJSON()
require.NoError(t, err)
i2 := new(accounting.Decimal)
require.NoError(t, i2.UnmarshalJSON(data))
require.Equal(t, i, i2)
}