NotContainsValue succeeds if object does not contain given value with any key. Before comparison, both object and value are converted to canonical form. Example: object := NewObject(t, map[string]interface{}{"foo": 123}) object.NotContainsValue(456)
(value interface{})
| 1082 | // object := NewObject(t, map[string]interface{}{"foo": 123}) |
| 1083 | // object.NotContainsValue(456) |
| 1084 | func (o *Object) NotContainsValue(value interface{}) *Object { |
| 1085 | opChain := o.chain.enter("NotContainsValue()") |
| 1086 | defer opChain.leave() |
| 1087 | |
| 1088 | if opChain.failed() { |
| 1089 | return o |
| 1090 | } |
| 1091 | |
| 1092 | if key, ok := containsValue(opChain, o.value, value); ok { |
| 1093 | opChain.fail(AssertionFailure{ |
| 1094 | Type: AssertNotContainsElement, |
| 1095 | Actual: &AssertionValue{o.value}, |
| 1096 | Expected: &AssertionValue{value}, |
| 1097 | Errors: []error{ |
| 1098 | errors.New("expected: map does not contain element (with any key)"), |
| 1099 | fmt.Errorf("found matching element with key %q", key), |
| 1100 | }, |
| 1101 | }) |
| 1102 | } |
| 1103 | |
| 1104 | return o |
| 1105 | } |
| 1106 | |
| 1107 | // ContainsSubset succeeds if given value is a subset of object. |
| 1108 | // Before comparison, both object and value are converted to canonical form. |