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

Function Test_userExampleCache_Set

internal/cache/userExample_test.go:34–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func Test_userExampleCache_Set(t *testing.T) {
35 c := newUserExampleCache()
36 defer c.Close()
37
38 record := c.TestDataSlice[0].(*model.UserExample)
39 err := c.ICache.(UserExampleCache).Set(c.Ctx, record.ID, record, time.Hour)
40 if err != nil {
41 t.Fatal(err)
42 }
43
44 // nil data
45 err = c.ICache.(UserExampleCache).Set(c.Ctx, 0, nil, time.Hour)
46 assert.NoError(t, err)
47}
48
49func Test_userExampleCache_Get(t *testing.T) {
50 c := newUserExampleCache()

Callers

nothing calls this directly

Calls 4

newUserExampleCacheFunction · 0.85
CloseMethod · 0.65
SetMethod · 0.65
FatalMethod · 0.45

Tested by

no test coverage detected