25 lines
554 B
Go
25 lines
554 B
Go
package cache_test
|
|
|
|
import (
|
|
"go_dreamfactory/pb"
|
|
"go_dreamfactory/sys/cache"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestFriendAdd(t *testing.T) {
|
|
err := cache.Defsys.FriendAdd(&pb.Cache_FriendData{
|
|
UserId: "629f159310d6970846f7ef26",
|
|
FriendId: []string{"629f147e3d276120561bfa18", "629eb3f4132dc4bb26139659"},
|
|
})
|
|
|
|
require.Nil(t, err, nil)
|
|
}
|
|
|
|
func TestFriendGetTotal(t *testing.T) {
|
|
total := cache.Defsys.FriendGetTotal("629f159310d6970846f7ef26")
|
|
assert.Equal(t, total, int32(1))
|
|
}
|