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

Method NotConsistsOf

array.go:1159–1184  ·  view source on GitHub ↗

NotConsistsOf is opposite to ConsistsOf. Example: array := NewArray(t, []interface{}{"foo", 123}) array.NotConsistsOf("foo") array.NotConsistsOf("foo", 123, 456) array.NotConsistsOf(123, "foo") These calls are equivalent: array.NotConsistsOf("a", "b") array.NotEqual([]interface{}{"a", "b"}

(values ...interface{})

Source from the content-addressed store, hash-verified

1157// array.NotConsistsOf("a", "b")
1158// array.NotEqual([]interface{}{"a", "b"})
1159func (a *Array) NotConsistsOf(values ...interface{}) *Array {
1160 opChain := a.chain.enter("NotConsistsOf()")
1161 defer opChain.leave()
1162
1163 if opChain.failed() {
1164 return a
1165 }
1166
1167 expected, ok := canonArray(opChain, values)
1168 if !ok {
1169 return a
1170 }
1171
1172 if reflect.DeepEqual(expected, a.value) {
1173 opChain.fail(AssertionFailure{
1174 Type: AssertNotEqual,
1175 Actual: &AssertionValue{a.value},
1176 Expected: &AssertionValue{expected},
1177 Errors: []error{
1178 errors.New("expected: arrays does not consist of given elements"),
1179 },
1180 })
1181 }
1182
1183 return a
1184}
1185
1186// Deprecated: use ConsistsOf instead.
1187func (a *Array) Elements(values ...interface{}) *Array {

Callers 3

NotElementsMethod · 0.95
TestArray_FailedChainFunction · 0.80
TestArray_ConsistsOfFunction · 0.80

Calls 5

canonArrayFunction · 0.85
enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
failMethod · 0.80

Tested by 2

TestArray_FailedChainFunction · 0.64
TestArray_ConsistsOfFunction · 0.64