[#140] sdk/object: Define Attribute type

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-10 14:49:17 +03:00 committed by Stanislav Bogatyrev
parent 5902f96f3e
commit 20d644758b
2 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,23 @@
package object
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestAttribute(t *testing.T) {
key, val := "some key", "some value"
a := NewAttribute()
a.SetKey(key)
a.SetValue(val)
require.Equal(t, key, a.GetKey())
require.Equal(t, val, a.GetValue())
aV2 := a.ToV2()
require.Equal(t, key, aV2.GetKey())
require.Equal(t, val, aV2.GetValue())
}