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

Function TestObject_Constructors

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

Source from the content-addressed store, hash-verified

87}
88
89func TestObject_Constructors(t *testing.T) {
90 test := map[string]interface{}{
91 "foo": 100.0,
92 }
93
94 t.Run("reporter", func(t *testing.T) {
95 reporter := newMockReporter(t)
96
97 value := NewObject(reporter, test)
98
99 value.IsEqual(test)
100 value.chain.assert(t, success)
101 })
102
103 t.Run("config", func(t *testing.T) {
104 reporter := newMockReporter(t)
105
106 value := NewObjectC(Config{
107 Reporter: reporter,
108 }, test)
109
110 value.IsEqual(test)
111 value.chain.assert(t, success)
112 })
113
114 t.Run("chain", func(t *testing.T) {
115 chain := newMockChain(t)
116
117 value := newObject(chain, test)
118
119 assert.NotSame(t, value.chain, chain)
120 assert.Equal(t, value.chain.context.Path, chain.context.Path)
121 })
122
123 t.Run("invalid value", func(t *testing.T) {
124 reporter := newMockReporter(t)
125
126 value := NewObject(reporter, nil)
127
128 value.chain.assert(t, failure)
129 })
130}
131
132func TestObject_Raw(t *testing.T) {
133 reporter := newMockReporter(t)

Callers

nothing calls this directly

Calls 8

IsEqualMethod · 0.95
newMockReporterFunction · 0.85
NewObjectFunction · 0.85
NewObjectCFunction · 0.85
newMockChainFunction · 0.85
newObjectFunction · 0.85
assertMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…