frostfs-sdk-go/object/object_test.go
Evgenii Baidakov 36b1e8442c
tests: Use dedicated function to generate signers in tests
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-04-26 15:03:55 +04:00

26 lines
559 B
Go

package object_test
import (
"testing"
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
"github.com/nspcc-dev/neofs-sdk-go/object"
usertest "github.com/nspcc-dev/neofs-sdk-go/user/test"
"github.com/stretchr/testify/require"
)
func TestInitCreation(t *testing.T) {
var o object.Object
cnr := cidtest.ID()
own := *usertest.ID(t)
object.InitCreation(&o, object.RequiredFields{
Container: cnr,
Owner: own,
})
cID, set := o.ContainerID()
require.True(t, set)
require.Equal(t, cnr, cID)
require.Equal(t, &own, o.OwnerID())
}