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

Function TestBoolean_InList

boolean_test.go:188–226  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

186}
187
188func TestBoolean_InList(t *testing.T) {
189 t.Run("basic", func(t *testing.T) {
190 for _, data := range []bool{true, false} {
191 t.Run(fmt.Sprintf("%v", data), func(t *testing.T) {
192 reporter := newMockReporter(t)
193
194 NewBoolean(reporter, data).InList(data).
195 chain.assert(t, success)
196
197 NewBoolean(reporter, data).InList(!data, data).
198 chain.assert(t, success)
199
200 NewBoolean(reporter, data).InList(!data, !data).
201 chain.assert(t, failure)
202
203 NewBoolean(reporter, data).NotInList(data).
204 chain.assert(t, failure)
205
206 NewBoolean(reporter, data).NotInList(!data, data).
207 chain.assert(t, failure)
208
209 NewBoolean(reporter, data).NotInList(!data, !data).
210 chain.assert(t, success)
211 })
212 }
213 })
214
215 t.Run("invalid argument", func(t *testing.T) {
216 for _, data := range []bool{true, false} {
217 reporter := newMockReporter(t)
218
219 NewBoolean(reporter, data).InList().
220 chain.assert(t, failure)
221
222 NewBoolean(reporter, data).NotInList().
223 chain.assert(t, failure)
224 }
225 })
226}

Callers

nothing calls this directly

Calls 5

newMockReporterFunction · 0.85
NewBooleanFunction · 0.85
assertMethod · 0.80
InListMethod · 0.45
NotInListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…