signaller/internal/backends/memory/user_test.go
2019-07-22 22:18:58 +05:00

22 lines
369 B
Go

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())
}