MCPcopy
hub / github.com/gin-gonic/gin / TestSetGetDelete

Function TestSetGetDelete

context_test.go:408–419  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

406}
407
408func TestSetGetDelete(t *testing.T) {
409 c, _ := CreateTestContext(httptest.NewRecorder())
410 key := "example-key"
411 value := "example-value"
412 c.Set(key, value)
413 val, exists := c.Get(key)
414 assert.True(t, exists)
415 assert.Equal(t, val, value)
416 c.Delete(key)
417 _, exists = c.Get(key)
418 assert.False(t, exists)
419}
420
421func TestContextGetInt(t *testing.T) {
422 c, _ := CreateTestContext(httptest.NewRecorder())

Callers

nothing calls this directly

Calls 4

CreateTestContextFunction · 0.85
SetMethod · 0.80
DeleteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected