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; | |
6 | |
7 import 'dart:convert'; | 5 import 'dart:convert'; |
8 | 6 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
10 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
11 import 'package:analysis_server/src/protocol/protocol_internal.dart'; | 10 import 'package:analysis_server/src/protocol/protocol_internal.dart'; |
12 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 | 13 |
15 main() { | 14 main() { |
16 defineReflectiveSuite(() { | 15 defineReflectiveSuite(() { |
17 defineReflectiveTests(NotificationTest); | 16 defineReflectiveTests(NotificationTest); |
18 defineReflectiveTests(RequestTest); | 17 defineReflectiveTests(RequestTest); |
19 defineReflectiveTests(RequestErrorTest); | 18 defineReflectiveTests(RequestErrorTest); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 void test_fromJson_withResult() { | 263 void test_fromJson_withResult() { |
265 Response original = new Response('myId', result: {'foo': 'bar'}); | 264 Response original = new Response('myId', result: {'foo': 'bar'}); |
266 Response response = new Response.fromJson(original.toJson()); | 265 Response response = new Response.fromJson(original.toJson()); |
267 expect(response.id, equals('myId')); | 266 expect(response.id, equals('myId')); |
268 Map<String, Object> result = | 267 Map<String, Object> result = |
269 response.toJson()['result'] as Map<String, Object>; | 268 response.toJson()['result'] as Map<String, Object>; |
270 expect(result.length, equals(1)); | 269 expect(result.length, equals(1)); |
271 expect(result['foo'], equals('bar')); | 270 expect(result['foo'], equals('bar')); |
272 } | 271 } |
273 } | 272 } |
OLD | NEW |