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

Side by Side Diff: pkg/analysis_server/test/operation/operation_analysis_test.dart

Issue 376693002: Extract testing utilities into a separate package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.operation.analysis; 5 library test.operation.analysis;
6 6
7 import 'package:analysis_server/src/constants.dart'; 7 import 'package:analysis_server/src/constants.dart';
8 import 'package:analysis_server/src/operation/operation_analysis.dart'; 8 import 'package:analysis_server/src/operation/operation_analysis.dart';
9 import 'package:analysis_testing/mocks.dart';
10 import 'package:analysis_testing/reflective_tests.dart';
9 import 'package:analyzer/src/generated/error.dart'; 11 import 'package:analyzer/src/generated/error.dart';
10 import 'package:analyzer/src/generated/source.dart'; 12 import 'package:analyzer/src/generated/source.dart';
11 import 'package:typed_mock/typed_mock.dart'; 13 import 'package:typed_mock/typed_mock.dart';
12 import 'package:unittest/unittest.dart'; 14 import 'package:unittest/unittest.dart';
13 15
14 import '../reflective_tests.dart';
15 import '../typed_mocks.dart';
16 16
17 main() { 17 main() {
18 groupSep = ' | '; 18 groupSep = ' | ';
19 19
20 group('errorToJson', () { 20 group('errorToJson', () {
21 runReflectiveTests(Test_errorToJson); 21 runReflectiveTests(Test_errorToJson);
22 }); 22 });
23 } 23 }
24 24
25 25
26 class AnalysisErrorMock extends TypedMock implements AnalysisError { 26 class AnalysisErrorMock extends TypedMock implements AnalysisError {
27 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 27 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
28 } 28 }
29 29
30 30
31 @ReflectiveTestCase() 31 @ReflectiveTestCase()
32 class Test_errorToJson { 32 class Test_errorToJson {
33 Source source = new SourceMock(); 33 Source source = new MockSource();
34 LineInfo lineInfo; 34 LineInfo lineInfo;
35 AnalysisError analysisError = new AnalysisErrorMock(); 35 AnalysisError analysisError = new AnalysisErrorMock();
36 36
37 void setUp() { 37 void setUp() {
38 // prepare Source 38 // prepare Source
39 when(source.fullName).thenReturn('foo.dart'); 39 when(source.fullName).thenReturn('foo.dart');
40 // prepare LineInfo 40 // prepare LineInfo
41 lineInfo = new LineInfo([0, 5, 9, 20]); 41 lineInfo = new LineInfo([0, 5, 9, 20]);
42 // prepare AnalysisError 42 // prepare AnalysisError
43 when(analysisError.source).thenReturn(source); 43 when(analysisError.source).thenReturn(source);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 OFFSET: 10, 97 OFFSET: 10,
98 LENGTH: 20, 98 LENGTH: 20,
99 START_LINE: 3, 99 START_LINE: 3,
100 START_COLUMN: 2 100 START_COLUMN: 2
101 }, 101 },
102 MESSAGE: 'my message', 102 MESSAGE: 'my message',
103 CORRECTION: 'my correction' 103 CORRECTION: 'my correction'
104 }); 104 });
105 } 105 }
106 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698