Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: pkg/analysis_server/test/edit/fixes_test.dart

Issue 492563002: Make more use of generated classes in analysis server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/edit/fixes_test.dart
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index db93c37078352788375f5bd5a0a2ae3e8d88cef2..808cd87984b9aa9f1ade5f3cd5ab93f5910beb8c 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -6,7 +6,6 @@ library test.edit.fixes;
import 'dart:async';
-import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/edit/edit_domain.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/protocol2.dart';
@@ -41,14 +40,15 @@ main() {
Request request = new EditGetFixesParams(testFile,
findOffset('print')).toRequest('0');
Response response = handleSuccessfulRequest(request);
- List<Map<String, Object>> errorFixesJsonList = response.getResult(FIXES);
- expect(errorFixesJsonList, hasLength(1));
+ var result = new EditGetFixesResult.fromResponse(response);
+ List<ErrorFixes> errorFixes = result.fixes;
+ expect(errorFixes, hasLength(1));
{
- Map<String, Object> fixes = errorFixesJsonList[0];
- Map<String, Object> error = fixes[ERROR];
- expect(error[SEVERITY], 'ERROR');
- expect(error[TYPE], 'SYNTACTIC_ERROR');
- expect(fixes[FIXES], hasLength(1));
+ ErrorFixes fixes = errorFixes[0];
+ AnalysisError error = fixes.error;
+ expect(error.severity, ErrorSeverity.ERROR);
+ expect(error.type, ErrorType.SYNTACTIC_ERROR);
+ expect(fixes.fixes, hasLength(1));
}
});
}

Powered by Google App Engine
This is Rietveld 408576698