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

Function TestArray_Constructors

array_test.go:96–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestArray_Constructors(t *testing.T) {
97 testValue := []interface{}{"Foo", 123}
98
99 t.Run("reporter", func(t *testing.T) {
100 reporter := newMockReporter(t)
101
102 value := NewArray(reporter, testValue)
103
104 value.IsEqual(testValue)
105 value.chain.assert(t, success)
106 })
107
108 t.Run("config", func(t *testing.T) {
109 reporter := newMockReporter(t)
110
111 value := NewArrayC(Config{
112 Reporter: reporter,
113 }, testValue)
114
115 value.IsEqual(testValue)
116 value.chain.assert(t, success)
117 })
118
119 t.Run("chain", func(t *testing.T) {
120 chain := newMockChain(t)
121
122 value := newArray(chain, testValue)
123
124 assert.NotSame(t, value.chain, chain)
125 assert.Equal(t, value.chain.context.Path, chain.context.Path)
126 })
127
128 t.Run("invalid value", func(t *testing.T) {
129 reporter := newMockReporter(t)
130
131 value := NewArray(reporter, nil)
132
133 value.chain.assert(t, failure)
134 })
135}
136
137func TestArray_Raw(t *testing.T) {
138 reporter := newMockReporter(t)

Callers

nothing calls this directly

Calls 8

IsEqualMethod · 0.95
newMockReporterFunction · 0.85
NewArrayFunction · 0.85
NewArrayCFunction · 0.85
newMockChainFunction · 0.85
newArrayFunction · 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…