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

Function newCacheNameExampleCache

internal/cache/cacheNameExample_test.go:21–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21func newCacheNameExampleCache() *gotest.Cache {
22 // change the type of the value before testing
23 var (
24 key = "foo1"
25 val = "bar1"
26 )
27
28 record1 := &cacheNameExampleData{ID: 1, Key: key, Value: val}
29 testData := map[string]interface{}{
30 utils.Uint64ToStr(record1.ID): record1,
31 }
32
33 c := gotest.NewCache(testData)
34 c.ICache = NewCacheNameExampleCache(&database.CacheType{
35 CType: "redis",
36 Rdb: c.RedisClient,
37 })
38 return c
39}
40
41func Test_cacheNameExampleCache_Set(t *testing.T) {
42 c := newCacheNameExampleCache()

Calls 3

Uint64ToStrFunction · 0.92
NewCacheFunction · 0.92
NewCacheNameExampleCacheFunction · 0.85

Tested by

no test coverage detected