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{})
| 1157 | // array.NotConsistsOf("a", "b") |
| 1158 | // array.NotEqual([]interface{}{"a", "b"}) |
| 1159 | func (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. |
| 1187 | func (a *Array) Elements(values ...interface{}) *Array { |