frostfs-api-go/pkg/accounting/decimal_test.go
Leonard Lyubich 52fae76533 [#168] sdk/accounting: Refactor Decimal type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-13 18:07:26 +03:00

25 lines
345 B
Go

package accounting
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestDecimal_Value(t *testing.T) {
d := NewDecimal()
v := int64(3)
d.SetValue(v)
require.Equal(t, v, d.Value())
}
func TestDecimal_Precision(t *testing.T) {
d := NewDecimal()
p := uint32(3)
d.SetPrecision(p)
require.Equal(t, p, d.Precision())
}