Add test coverage to core

This commit is contained in:
2022-10-30 01:16:31 -04:00
parent 454b42c2d7
commit b542fcf901
4 changed files with 77 additions and 0 deletions

23
core/user_test.go Normal file
View File

@@ -0,0 +1,23 @@
package core
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUserMention(t *testing.T) {
assert := assert.New(t)
// Create user object
user := &User{
ID: "sample_id",
}
assert.Equal("<@sample_id>", user.Mention())
// Test null user
var nullUser *User = nil
assert.NotEmpty(nullUser.Mention())
}