| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.protocol; | 5 library test.protocol; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 expect(response.error, isNotNull); | 259 expect(response.error, isNotNull); |
| 260 RequestError error = response.error; | 260 RequestError error = response.error; |
| 261 expect(error.code, equals(RequestErrorCode.INVALID_REQUEST)); | 261 expect(error.code, equals(RequestErrorCode.INVALID_REQUEST)); |
| 262 expect(error.message, equals('Invalid request')); | 262 expect(error.message, equals('Invalid request')); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void test_fromJson_withResult() { | 265 void test_fromJson_withResult() { |
| 266 Response original = new Response('myId', result: {'foo': 'bar'}); | 266 Response original = new Response('myId', result: {'foo': 'bar'}); |
| 267 Response response = new Response.fromJson(original.toJson()); | 267 Response response = new Response.fromJson(original.toJson()); |
| 268 expect(response.id, equals('myId')); | 268 expect(response.id, equals('myId')); |
| 269 Map<String, Object> result = response.toJson()['result']; | 269 Map<String, Object> result = |
| 270 response.toJson()['result'] as Map<String, Object>; |
| 270 expect(result.length, equals(1)); | 271 expect(result.length, equals(1)); |
| 271 expect(result['foo'], equals('bar')); | 272 expect(result['foo'], equals('bar')); |
| 272 } | 273 } |
| 273 } | 274 } |
| OLD | NEW |