MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / newUserExampleCache

Function newUserExampleCache

internal/cache/userExample_test.go:16–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func newUserExampleCache() *gotest.Cache {
17 record1 := &model.UserExample{}
18 record1.ID = 1
19 record2 := &model.UserExample{}
20 record2.ID = 2
21 testData := map[string]interface{}{
22 utils.Uint64ToStr(record1.ID): record1,
23 utils.Uint64ToStr(record2.ID): record2,
24 }
25
26 c := gotest.NewCache(testData)
27 c.ICache = NewUserExampleCache(&database.CacheType{
28 CType: "redis",
29 Rdb: c.RedisClient,
30 })
31 return c
32}
33
34func Test_userExampleCache_Set(t *testing.T) {
35 c := newUserExampleCache()

Calls 3

Uint64ToStrFunction · 0.92
NewCacheFunction · 0.92
NewUserExampleCacheFunction · 0.85

Tested by

no test coverage detected