Added arn to the main repository

This commit is contained in:
2019-06-03 18:32:43 +09:00
parent cf258573a8
commit 29a48d94a5
465 changed files with 15968 additions and 288 deletions

25
arn/User_test.go Normal file
View File

@ -0,0 +1,25 @@
package arn_test
import (
"strings"
"testing"
"github.com/animenotifier/notify.moe/arn"
"github.com/stretchr/testify/assert"
)
func TestNewUser(t *testing.T) {
user := arn.NewUser()
assert.NotNil(t, user)
assert.NotEmpty(t, user.ID)
}
func TestDatabaseErrorMessages(t *testing.T) {
_, err := arn.GetUser("NON EXISTENT USER ID")
// We need to make sure that non-existent records return "not found" in the error message.
assert.NotNil(t, err)
assert.NotEmpty(t, err.Error())
assert.NotEqual(t, -1, strings.Index(err.Error(), "not found"))
}