2022-03-05 14:21:16 +00:00
|
|
|
package object_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/object"
|
|
|
|
ownertest "github.com/nspcc-dev/neofs-sdk-go/owner/test"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInitCreation(t *testing.T) {
|
|
|
|
var o object.Object
|
2022-04-11 16:25:14 +00:00
|
|
|
cnr := cidtest.ID()
|
2022-03-05 14:21:16 +00:00
|
|
|
own := *ownertest.ID()
|
|
|
|
|
|
|
|
object.InitCreation(&o, object.RequiredFields{
|
|
|
|
Container: cnr,
|
|
|
|
Owner: own,
|
|
|
|
})
|
|
|
|
|
2022-04-11 16:25:14 +00:00
|
|
|
require.Equal(t, cnr, o.ContainerID())
|
2022-03-05 14:21:16 +00:00
|
|
|
require.Equal(t, &own, o.OwnerID())
|
|
|
|
}
|