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

Side by Side Diff: generated/googleapis/test/webfonts/v1_test.dart

Issue 595873002: Api roll 1: 2014-09-23 (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 library googleapis.webfonts.v1.test; 1 library googleapis.webfonts.v1.test;
2 2
3 import "dart:core" as core; 3 import "dart:core" as core;
4 import "dart:collection" as collection; 4 import "dart:collection" as collection;
5 import "dart:async" as async; 5 import "dart:async" as async;
6 import "dart:convert" as convert; 6 import "dart:convert" as convert;
7 7
8 import 'package:http/http.dart' as http; 8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing; 9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest; 10 import 'package:unittest/unittest.dart' as unittest;
11 import 'package:googleapis/common/common.dart' as common; 11 import 'package:googleapis/common/common.dart' as common;
12 import 'package:googleapis/src/common_internal.dart' as common_internal; 12 import 'package:googleapis/src/common_internal.dart' as common_internal;
13 import '../common/common_internal_test.dart' as common_test; 13 import '../common/common_internal_test.dart' as common_test;
14 14
15 import 'package:googleapis/webfonts/v1.dart' as api; 15 import 'package:googleapis/webfonts/v1.dart' as api;
16 16
17 17
18 18
19 buildUnnamed761() { 19 buildUnnamed789() {
20 var o = new core.Map<core.String, core.String>(); 20 var o = new core.Map<core.String, core.String>();
21 o["x"] = "foo"; 21 o["x"] = "foo";
22 o["y"] = "foo"; 22 o["y"] = "foo";
23 return o; 23 return o;
24 } 24 }
25 25
26 checkUnnamed761(core.Map<core.String, core.String> o) { 26 checkUnnamed789(core.Map<core.String, core.String> o) {
27 unittest.expect(o, unittest.hasLength(2)); 27 unittest.expect(o, unittest.hasLength(2));
28 unittest.expect(o["x"], unittest.equals('foo')); 28 unittest.expect(o["x"], unittest.equals('foo'));
29 unittest.expect(o["y"], unittest.equals('foo')); 29 unittest.expect(o["y"], unittest.equals('foo'));
30 } 30 }
31 31
32 buildUnnamed762() { 32 buildUnnamed790() {
33 var o = new core.List<core.String>(); 33 var o = new core.List<core.String>();
34 o.add("foo"); 34 o.add("foo");
35 o.add("foo"); 35 o.add("foo");
36 return o; 36 return o;
37 } 37 }
38 38
39 checkUnnamed762(core.List<core.String> o) { 39 checkUnnamed790(core.List<core.String> o) {
40 unittest.expect(o, unittest.hasLength(2)); 40 unittest.expect(o, unittest.hasLength(2));
41 unittest.expect(o[0], unittest.equals('foo')); 41 unittest.expect(o[0], unittest.equals('foo'));
42 unittest.expect(o[1], unittest.equals('foo')); 42 unittest.expect(o[1], unittest.equals('foo'));
43 } 43 }
44 44
45 buildUnnamed763() { 45 buildUnnamed791() {
46 var o = new core.List<core.String>(); 46 var o = new core.List<core.String>();
47 o.add("foo"); 47 o.add("foo");
48 o.add("foo"); 48 o.add("foo");
49 return o; 49 return o;
50 } 50 }
51 51
52 checkUnnamed763(core.List<core.String> o) { 52 checkUnnamed791(core.List<core.String> o) {
53 unittest.expect(o, unittest.hasLength(2)); 53 unittest.expect(o, unittest.hasLength(2));
54 unittest.expect(o[0], unittest.equals('foo')); 54 unittest.expect(o[0], unittest.equals('foo'));
55 unittest.expect(o[1], unittest.equals('foo')); 55 unittest.expect(o[1], unittest.equals('foo'));
56 } 56 }
57 57
58 core.int buildCounterWebfont = 0; 58 core.int buildCounterWebfont = 0;
59 buildWebfont() { 59 buildWebfont() {
60 var o = new api.Webfont(); 60 var o = new api.Webfont();
61 buildCounterWebfont++; 61 buildCounterWebfont++;
62 if (buildCounterWebfont < 3) { 62 if (buildCounterWebfont < 3) {
63 o.category = "foo"; 63 o.category = "foo";
64 o.family = "foo"; 64 o.family = "foo";
65 o.files = buildUnnamed761(); 65 o.files = buildUnnamed789();
66 o.kind = "foo"; 66 o.kind = "foo";
67 o.lastModified = core.DateTime.parse("2002-02-27T14:01:02Z"); 67 o.lastModified = core.DateTime.parse("2002-02-27T14:01:02Z");
68 o.subsets = buildUnnamed762(); 68 o.subsets = buildUnnamed790();
69 o.variants = buildUnnamed763(); 69 o.variants = buildUnnamed791();
70 o.version = "foo"; 70 o.version = "foo";
71 } 71 }
72 buildCounterWebfont--; 72 buildCounterWebfont--;
73 return o; 73 return o;
74 } 74 }
75 75
76 checkWebfont(api.Webfont o) { 76 checkWebfont(api.Webfont o) {
77 buildCounterWebfont++; 77 buildCounterWebfont++;
78 if (buildCounterWebfont < 3) { 78 if (buildCounterWebfont < 3) {
79 unittest.expect(o.category, unittest.equals('foo')); 79 unittest.expect(o.category, unittest.equals('foo'));
80 unittest.expect(o.family, unittest.equals('foo')); 80 unittest.expect(o.family, unittest.equals('foo'));
81 checkUnnamed761(o.files); 81 checkUnnamed789(o.files);
82 unittest.expect(o.kind, unittest.equals('foo')); 82 unittest.expect(o.kind, unittest.equals('foo'));
83 unittest.expect(o.lastModified, unittest.equals(core.DateTime.parse("2002-02 -27T00:00:00"))); 83 unittest.expect(o.lastModified, unittest.equals(core.DateTime.parse("2002-02 -27T00:00:00")));
84 checkUnnamed762(o.subsets); 84 checkUnnamed790(o.subsets);
85 checkUnnamed763(o.variants); 85 checkUnnamed791(o.variants);
86 unittest.expect(o.version, unittest.equals('foo')); 86 unittest.expect(o.version, unittest.equals('foo'));
87 } 87 }
88 buildCounterWebfont--; 88 buildCounterWebfont--;
89 } 89 }
90 90
91 buildUnnamed764() { 91 buildUnnamed792() {
92 var o = new core.List<api.Webfont>(); 92 var o = new core.List<api.Webfont>();
93 o.add(buildWebfont()); 93 o.add(buildWebfont());
94 o.add(buildWebfont()); 94 o.add(buildWebfont());
95 return o; 95 return o;
96 } 96 }
97 97
98 checkUnnamed764(core.List<api.Webfont> o) { 98 checkUnnamed792(core.List<api.Webfont> o) {
99 unittest.expect(o, unittest.hasLength(2)); 99 unittest.expect(o, unittest.hasLength(2));
100 checkWebfont(o[0]); 100 checkWebfont(o[0]);
101 checkWebfont(o[1]); 101 checkWebfont(o[1]);
102 } 102 }
103 103
104 core.int buildCounterWebfontList = 0; 104 core.int buildCounterWebfontList = 0;
105 buildWebfontList() { 105 buildWebfontList() {
106 var o = new api.WebfontList(); 106 var o = new api.WebfontList();
107 buildCounterWebfontList++; 107 buildCounterWebfontList++;
108 if (buildCounterWebfontList < 3) { 108 if (buildCounterWebfontList < 3) {
109 o.items = buildUnnamed764(); 109 o.items = buildUnnamed792();
110 o.kind = "foo"; 110 o.kind = "foo";
111 } 111 }
112 buildCounterWebfontList--; 112 buildCounterWebfontList--;
113 return o; 113 return o;
114 } 114 }
115 115
116 checkWebfontList(api.WebfontList o) { 116 checkWebfontList(api.WebfontList o) {
117 buildCounterWebfontList++; 117 buildCounterWebfontList++;
118 if (buildCounterWebfontList < 3) { 118 if (buildCounterWebfontList < 3) {
119 checkUnnamed764(o.items); 119 checkUnnamed792(o.items);
120 unittest.expect(o.kind, unittest.equals('foo')); 120 unittest.expect(o.kind, unittest.equals('foo'));
121 } 121 }
122 buildCounterWebfontList--; 122 buildCounterWebfontList--;
123 } 123 }
124 124
125 125
126 main() { 126 main() {
127 unittest.group("obj-schema-Webfont", () { 127 unittest.group("obj-schema-Webfont", () {
128 unittest.test("to-json--from-json", () { 128 unittest.test("to-json--from-json", () {
129 var o = buildWebfont(); 129 var o = buildWebfont();
(...skipping 16 matching lines...) Expand all
146 unittest.test("method--list", () { 146 unittest.test("method--list", () {
147 147
148 var mock = new common_test.HttpServerMock(); 148 var mock = new common_test.HttpServerMock();
149 api.WebfontsResourceApi res = new api.WebfontsApi(mock).webfonts; 149 api.WebfontsResourceApi res = new api.WebfontsApi(mock).webfonts;
150 var arg_sort = "foo"; 150 var arg_sort = "foo";
151 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 151 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
152 var path = (req.url).path; 152 var path = (req.url).path;
153 var pathOffset = 0; 153 var pathOffset = 0;
154 var index; 154 var index;
155 var subPart; 155 var subPart;
156 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq uals("/webfonts/v1/")); 156 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
157 pathOffset += 13; 157 pathOffset += 1;
158 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq uals("webfonts/v1/"));
159 pathOffset += 12;
158 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("webfonts")); 160 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("webfonts"));
159 pathOffset += 8; 161 pathOffset += 8;
160 162
161 var query = (req.url).query; 163 var query = (req.url).query;
162 var queryOffset = 0; 164 var queryOffset = 0;
163 var queryMap = {}; 165 var queryMap = {};
164 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 166 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
165 parseBool(n) { 167 parseBool(n) {
166 if (n == "true") return true; 168 if (n == "true") return true;
167 if (n == "false") return false; 169 if (n == "false") return false;
(...skipping 18 matching lines...) Expand all
186 res.list(sort: arg_sort).then(unittest.expectAsync(((api.WebfontList respo nse) { 188 res.list(sort: arg_sort).then(unittest.expectAsync(((api.WebfontList respo nse) {
187 checkWebfontList(response); 189 checkWebfontList(response);
188 }))); 190 })));
189 }); 191 });
190 192
191 }); 193 });
192 194
193 195
194 } 196 }
195 197
OLDNEW
« no previous file with comments | « generated/googleapis/test/urlshortener/v1_test.dart ('k') | generated/googleapis/test/youtube/v3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698