[#149] sdk/object: Add address field getters and setters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
7ef249f8db
commit
353448c0c3
2 changed files with 54 additions and 0 deletions
29
pkg/object/address_test.go
Normal file
29
pkg/object/address_test.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestAddress_SetContainerID(t *testing.T) {
|
||||
a := NewAddress()
|
||||
|
||||
cid := container.NewID()
|
||||
cid.SetSHA256(randSHA256Checksum(t))
|
||||
|
||||
a.SetContainerID(cid)
|
||||
|
||||
require.Equal(t, cid, a.GetContainerID())
|
||||
}
|
||||
|
||||
func TestAddress_SetObjectID(t *testing.T) {
|
||||
a := NewAddress()
|
||||
|
||||
oid := randID(t)
|
||||
|
||||
a.SetObjectID(oid)
|
||||
|
||||
require.Equal(t, oid, a.GetObjectID())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue