MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestEnvironment_Time

Function TestEnvironment_Time

environment_test.go:473–509  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

471}
472
473func TestEnvironment_Time(t *testing.T) {
474 cases := []struct {
475 put interface{}
476 get time.Time
477 result chainResult
478 }{
479 {
480 put: time.Unix(9999999, 0),
481 get: time.Unix(9999999, 0),
482 result: success,
483 },
484 {
485 put: 9999999,
486 get: time.Unix(0, 0),
487 result: failure,
488 },
489 {
490 put: time.Unix(9999999, 0).String(),
491 get: time.Unix(0, 0),
492 result: failure,
493 },
494 }
495 for _, tc := range cases {
496 t.Run(fmt.Sprintf("%T-%v", tc.put, tc.put),
497 func(t *testing.T) {
498 env := newEnvironment(newMockChain(t))
499
500 env.Put("key", tc.put)
501 env.chain.assert(t, success)
502
503 val := env.GetTime("key")
504 assert.Equal(t, tc.get, val)
505
506 env.chain.assert(t, tc.result)
507 })
508 }
509}
510
511func TestEnvironment_List(t *testing.T) {
512 env := newEnvironment(newMockChain(t))

Callers

nothing calls this directly

Calls 7

newEnvironmentFunction · 0.85
newMockChainFunction · 0.85
PutMethod · 0.80
assertMethod · 0.80
GetTimeMethod · 0.80
StringMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…