2020-05-08 11:46:09 +02:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewLink(t *testing.T) {
|
2020-06-22 15:16:26 +02:00
|
|
|
link := NewLink("st9lxuqxpogaaba1", true, false)
|
|
|
|
assert.Equal(t, "st9lxuqxpogaaba1", link.ShareUID)
|
2020-05-08 11:46:09 +02:00
|
|
|
assert.Equal(t, false, link.CanEdit)
|
|
|
|
assert.Equal(t, true, link.CanComment)
|
2020-06-22 15:16:26 +02:00
|
|
|
assert.Equal(t, 10, len(link.ShareToken))
|
|
|
|
assert.Equal(t, 16, len(link.LinkUID))
|
2020-05-08 11:46:09 +02:00
|
|
|
}
|