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

Side by Side Diff: samples/github/lib/src/tests/github_api_test.dart

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « samples/github/lib/src/tests/commit_list_test_disabled.dart ('k') | samples/samples.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE.md file.
4
5 import 'package:expect/expect.dart';
6
7 import '../github_services.dart';
8 import '../github_mock.dart';
9
10 void main() {
11 var mock = new GithubMock()..verbose = true..spawn();
12 var server = new Server(mock.host, mock.port);
13 testError(server);
14 testUser(server);
15 testRepository(server);
16 testCommits(server);
17 server.close();
18 mock.close();
19 }
20
21 void testUser(Server server) {
22 var user = server.getUser('dartino');
23 Expect.stringEquals('dartino', user['login']);
24 }
25
26 void testRepository(Server server) {
27 var user = server.getUser('dartino');
28 var repo = user.getRepository('sdk');
29 Expect.stringEquals('dartino/sdk', repo['full_name']);
30 }
31
32 void testError(Server server) {
33 var user = server.getUser('dartino-no-such-user');
34 Expect.throws(() { user['login']; });
35 }
36
37 void testCommits(Server server) {
38 var user = server.getUser('dartino');
39 var repo = user.getRepository('sdk');
40 var commit = repo.getCommitAt(0);
41 Expect.stringEquals('Martin Kustermann', commit['commit']['author']['name']);
42 commit = repo.getCommitAt(60);
43 Expect.stringEquals('Søren Gjesse', commit['commit']['author']['name']);
44 }
OLDNEW
« no previous file with comments | « samples/github/lib/src/tests/commit_list_test_disabled.dart ('k') | samples/samples.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698