frostfs-sdk-go/object/error_test.go
Evgenii Stratonikov 39d3317ef6 [#64] object: move package from neofs-api-go
Also, remove deprecated method.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-09 09:57:37 +03:00

33 lines
644 B
Go

package object_test
import (
"errors"
"testing"
"github.com/nspcc-dev/neofs-sdk-go/object"
"github.com/stretchr/testify/require"
)
func TestNewSplitInfoError(t *testing.T) {
var (
si = generateSplitInfo()
err error = object.NewSplitInfoError(si)
expectedErr *object.SplitInfoError
)
require.True(t, errors.As(err, &expectedErr))
siErr, ok := err.(*object.SplitInfoError)
require.True(t, ok)
require.Equal(t, si, siErr.SplitInfo())
}
func generateSplitInfo() *object.SplitInfo {
si := object.NewSplitInfo()
si.SetSplitID(object.NewSplitID())
si.SetLastPart(generateID())
si.SetLink(generateID())
return si
}