forked from TrueCloudLab/frostfs-api-go
[#168] sdk/accounting: Refactor Decimal type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e721734599
commit
52fae76533
4 changed files with 62 additions and 6 deletions
25
pkg/accounting/decimal_test.go
Normal file
25
pkg/accounting/decimal_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
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())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue