signaller/internal/backends/memory/user_test.go

22 lines
369 B
Go
Raw Normal View History

2019-07-22 14:31:33 +00:00
package memory
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUserID(t *testing.T) {
var (
userName = "user1"
hostName = "localhost"
expectedUserID = "@user1:localhost"
)
backend := NewBackend(hostName)
user, _, err := backend.Register(userName, "", "")
assert.Nil(t, err)
assert.Equal(t, expectedUserID, user.ID())
}