MCPcopy Create free account
hub / github.com/gavv/httpexpect / TestObject_Iter

Function TestObject_Iter

object_test.go:1396–1417  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1394}
1395
1396func TestObject_Iter(t *testing.T) {
1397 reporter := newMockReporter(t)
1398
1399 m := map[string]interface{}{
1400 "foo": 123.0,
1401 "bar": []interface{}{"456", 789.0},
1402 }
1403
1404 value := NewObject(reporter, m)
1405
1406 it := value.Iter()
1407
1408 assert.NotNil(t, it)
1409 assert.Equal(t, 2, len(it))
1410 assert.Equal(t, it["foo"].value, value.Value("foo").Raw())
1411 assert.Equal(t, it["bar"].value, value.Value("bar").Raw())
1412
1413 it["foo"].chain.assert(t, success)
1414 it["bar"].chain.assert(t, success)
1415
1416 value.chain.assert(t, success)
1417}
1418
1419func TestObject_Every(t *testing.T) {
1420 t.Run("check value", func(t *testing.T) {

Callers

nothing calls this directly

Calls 7

IterMethod · 0.95
ValueMethod · 0.95
newMockReporterFunction · 0.85
NewObjectFunction · 0.85
assertMethod · 0.80
EqualMethod · 0.45
RawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…