mismatch method
Create an exception to throw if the JSON object at jsonPath
fails to
match the API definition of expected
.
Implementation
@override
dynamic mismatch(String jsonPath, String expected, [Object? actual]) {
var buffer = StringBuffer();
buffer.write('Expected ');
buffer.write(expected);
if (actual != null) {
buffer.write(' found "');
buffer.write(json.encode(actual));
buffer.write('"');
}
buffer.write(' at ');
buffer.write(jsonPath);
return Exception(buffer.toString());
}