OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 import 'package:immi/immi.dart'; | 7 import 'package:immi/immi.dart'; |
8 import 'package:immi_samples/sliding_window.dart'; | 8 import 'package:immi_samples/sliding_window.dart'; |
9 import 'package:service/struct.dart'; | 9 import 'package:service/struct.dart'; |
10 | 10 |
11 import 'package:immi_gen/dart/immi_service.dart'; | 11 import 'package:immi_gen/dart/immi_service.dart'; |
12 | 12 |
13 import '../../github_immi.dart'; | 13 import '../../github_immi.dart'; |
14 import '../github_services.dart'; | 14 import '../github_services.dart'; |
15 import '../github_mock.dart'; | 15 import '../github_mock.dart'; |
16 import '../commit_list_presenter.dart'; | 16 import '../commit_list_presenter.dart'; |
17 import '../commit_presenter.dart'; | 17 import '../commit_presenter.dart'; |
18 | 18 |
19 void main() { | 19 void main() { |
20 var mock = new GithubMock()..spawn(); | 20 var mock = new GithubMock()..spawn(); |
21 var server = new Server(mock.host, mock.port); | 21 var server = new Server(mock.host, mock.port); |
22 var user = server.getUser('dart-lang'); | 22 var user = server.getUser('dart-lang'); |
23 var repo = user.getRepository('fletch'); | 23 var repo = user.getRepository('dartino'); |
24 testPresent(repo); | 24 testPresent(repo); |
25 server.close(); | 25 server.close(); |
26 mock.close(); | 26 mock.close(); |
27 } | 27 } |
28 | 28 |
29 void testPresent(Repository repo) { | 29 void testPresent(Repository repo) { |
30 var presenter = new CommitListPresenter(repo); | 30 var presenter = new CommitListPresenter(repo); |
31 SlidingWindowNode previous = null; | 31 SlidingWindowNode previous = null; |
32 SlidingWindowNode current = null; | 32 SlidingWindowNode current = null; |
33 CommitNode commitNode = null; | 33 CommitNode commitNode = null; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 testDiff(Node previous, Node current) { | 81 testDiff(Node previous, Node current) { |
82 NodePatch patch = current.diff(previous); | 82 NodePatch patch = current.diff(previous); |
83 Expect.isNotNull(patch); | 83 Expect.isNotNull(patch); |
84 | 84 |
85 // Check that we can successfully serialize the data. | 85 // Check that we can successfully serialize the data. |
86 var manager = new ResourceManager(); | 86 var manager = new ResourceManager(); |
87 var mb = new MessageBuilder(24); | 87 var mb = new MessageBuilder(24); |
88 PatchDataBuilder builder = mb.initRoot(new PatchDataBuilder(), 16); | 88 PatchDataBuilder builder = mb.initRoot(new PatchDataBuilder(), 16); |
89 patch.serializeNode(builder.initNode(), manager); | 89 patch.serializeNode(builder.initNode(), manager); |
90 } | 90 } |
OLD | NEW |