2020-07-13 16:12:32 +02:00
|
|
|
package session
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2020-11-21 18:08:41 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-07-13 16:12:32 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestUIDs_String(t *testing.T) {
|
|
|
|
uid := UIDs{"dghjkfd", "dfgehrih"}
|
|
|
|
assert.Equal(t, "dghjkfd,dfgehrih", uid.String())
|
|
|
|
}
|
|
|
|
|
2020-12-31 12:34:06 +01:00
|
|
|
func TestUIDs_Join(t *testing.T) {
|
|
|
|
uid := UIDs{"dghjkfd", "dfgehrih"}
|
|
|
|
assert.Equal(t, "dghjkfd|dfgehrih", uid.Join("|"))
|
|
|
|
}
|
|
|
|
|
2020-07-13 16:12:32 +02:00
|
|
|
func TestData_HasShare(t *testing.T) {
|
|
|
|
data := Data{Shares: []string{"abc123", "def444"}}
|
|
|
|
assert.True(t, data.HasShare("def444"))
|
|
|
|
assert.False(t, data.HasShare("xxx"))
|
|
|
|
}
|