OLD | NEW |
1 library googleapis.acceleratedmobilepageurl.v1.test; | 1 library googleapis.acceleratedmobilepageurl.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; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 checkAmpUrlError(api.AmpUrlError o) { | 90 checkAmpUrlError(api.AmpUrlError o) { |
91 buildCounterAmpUrlError++; | 91 buildCounterAmpUrlError++; |
92 if (buildCounterAmpUrlError < 3) { | 92 if (buildCounterAmpUrlError < 3) { |
93 unittest.expect(o.errorCode, unittest.equals('foo')); | 93 unittest.expect(o.errorCode, unittest.equals('foo')); |
94 unittest.expect(o.errorMessage, unittest.equals('foo')); | 94 unittest.expect(o.errorMessage, unittest.equals('foo')); |
95 unittest.expect(o.originalUrl, unittest.equals('foo')); | 95 unittest.expect(o.originalUrl, unittest.equals('foo')); |
96 } | 96 } |
97 buildCounterAmpUrlError--; | 97 buildCounterAmpUrlError--; |
98 } | 98 } |
99 | 99 |
100 buildUnnamed1100() { | 100 buildUnnamed1109() { |
101 var o = new core.List<core.String>(); | 101 var o = new core.List<core.String>(); |
102 o.add("foo"); | 102 o.add("foo"); |
103 o.add("foo"); | 103 o.add("foo"); |
104 return o; | 104 return o; |
105 } | 105 } |
106 | 106 |
107 checkUnnamed1100(core.List<core.String> o) { | 107 checkUnnamed1109(core.List<core.String> o) { |
108 unittest.expect(o, unittest.hasLength(2)); | 108 unittest.expect(o, unittest.hasLength(2)); |
109 unittest.expect(o[0], unittest.equals('foo')); | 109 unittest.expect(o[0], unittest.equals('foo')); |
110 unittest.expect(o[1], unittest.equals('foo')); | 110 unittest.expect(o[1], unittest.equals('foo')); |
111 } | 111 } |
112 | 112 |
113 core.int buildCounterBatchGetAmpUrlsRequest = 0; | 113 core.int buildCounterBatchGetAmpUrlsRequest = 0; |
114 buildBatchGetAmpUrlsRequest() { | 114 buildBatchGetAmpUrlsRequest() { |
115 var o = new api.BatchGetAmpUrlsRequest(); | 115 var o = new api.BatchGetAmpUrlsRequest(); |
116 buildCounterBatchGetAmpUrlsRequest++; | 116 buildCounterBatchGetAmpUrlsRequest++; |
117 if (buildCounterBatchGetAmpUrlsRequest < 3) { | 117 if (buildCounterBatchGetAmpUrlsRequest < 3) { |
118 o.lookupStrategy = "foo"; | 118 o.lookupStrategy = "foo"; |
119 o.urls = buildUnnamed1100(); | 119 o.urls = buildUnnamed1109(); |
120 } | 120 } |
121 buildCounterBatchGetAmpUrlsRequest--; | 121 buildCounterBatchGetAmpUrlsRequest--; |
122 return o; | 122 return o; |
123 } | 123 } |
124 | 124 |
125 checkBatchGetAmpUrlsRequest(api.BatchGetAmpUrlsRequest o) { | 125 checkBatchGetAmpUrlsRequest(api.BatchGetAmpUrlsRequest o) { |
126 buildCounterBatchGetAmpUrlsRequest++; | 126 buildCounterBatchGetAmpUrlsRequest++; |
127 if (buildCounterBatchGetAmpUrlsRequest < 3) { | 127 if (buildCounterBatchGetAmpUrlsRequest < 3) { |
128 unittest.expect(o.lookupStrategy, unittest.equals('foo')); | 128 unittest.expect(o.lookupStrategy, unittest.equals('foo')); |
129 checkUnnamed1100(o.urls); | 129 checkUnnamed1109(o.urls); |
130 } | 130 } |
131 buildCounterBatchGetAmpUrlsRequest--; | 131 buildCounterBatchGetAmpUrlsRequest--; |
132 } | 132 } |
133 | 133 |
134 buildUnnamed1101() { | 134 buildUnnamed1110() { |
135 var o = new core.List<api.AmpUrl>(); | 135 var o = new core.List<api.AmpUrl>(); |
136 o.add(buildAmpUrl()); | 136 o.add(buildAmpUrl()); |
137 o.add(buildAmpUrl()); | 137 o.add(buildAmpUrl()); |
138 return o; | 138 return o; |
139 } | 139 } |
140 | 140 |
141 checkUnnamed1101(core.List<api.AmpUrl> o) { | 141 checkUnnamed1110(core.List<api.AmpUrl> o) { |
142 unittest.expect(o, unittest.hasLength(2)); | 142 unittest.expect(o, unittest.hasLength(2)); |
143 checkAmpUrl(o[0]); | 143 checkAmpUrl(o[0]); |
144 checkAmpUrl(o[1]); | 144 checkAmpUrl(o[1]); |
145 } | 145 } |
146 | 146 |
147 buildUnnamed1102() { | 147 buildUnnamed1111() { |
148 var o = new core.List<api.AmpUrlError>(); | 148 var o = new core.List<api.AmpUrlError>(); |
149 o.add(buildAmpUrlError()); | 149 o.add(buildAmpUrlError()); |
150 o.add(buildAmpUrlError()); | 150 o.add(buildAmpUrlError()); |
151 return o; | 151 return o; |
152 } | 152 } |
153 | 153 |
154 checkUnnamed1102(core.List<api.AmpUrlError> o) { | 154 checkUnnamed1111(core.List<api.AmpUrlError> o) { |
155 unittest.expect(o, unittest.hasLength(2)); | 155 unittest.expect(o, unittest.hasLength(2)); |
156 checkAmpUrlError(o[0]); | 156 checkAmpUrlError(o[0]); |
157 checkAmpUrlError(o[1]); | 157 checkAmpUrlError(o[1]); |
158 } | 158 } |
159 | 159 |
160 core.int buildCounterBatchGetAmpUrlsResponse = 0; | 160 core.int buildCounterBatchGetAmpUrlsResponse = 0; |
161 buildBatchGetAmpUrlsResponse() { | 161 buildBatchGetAmpUrlsResponse() { |
162 var o = new api.BatchGetAmpUrlsResponse(); | 162 var o = new api.BatchGetAmpUrlsResponse(); |
163 buildCounterBatchGetAmpUrlsResponse++; | 163 buildCounterBatchGetAmpUrlsResponse++; |
164 if (buildCounterBatchGetAmpUrlsResponse < 3) { | 164 if (buildCounterBatchGetAmpUrlsResponse < 3) { |
165 o.ampUrls = buildUnnamed1101(); | 165 o.ampUrls = buildUnnamed1110(); |
166 o.urlErrors = buildUnnamed1102(); | 166 o.urlErrors = buildUnnamed1111(); |
167 } | 167 } |
168 buildCounterBatchGetAmpUrlsResponse--; | 168 buildCounterBatchGetAmpUrlsResponse--; |
169 return o; | 169 return o; |
170 } | 170 } |
171 | 171 |
172 checkBatchGetAmpUrlsResponse(api.BatchGetAmpUrlsResponse o) { | 172 checkBatchGetAmpUrlsResponse(api.BatchGetAmpUrlsResponse o) { |
173 buildCounterBatchGetAmpUrlsResponse++; | 173 buildCounterBatchGetAmpUrlsResponse++; |
174 if (buildCounterBatchGetAmpUrlsResponse < 3) { | 174 if (buildCounterBatchGetAmpUrlsResponse < 3) { |
175 checkUnnamed1101(o.ampUrls); | 175 checkUnnamed1110(o.ampUrls); |
176 checkUnnamed1102(o.urlErrors); | 176 checkUnnamed1111(o.urlErrors); |
177 } | 177 } |
178 buildCounterBatchGetAmpUrlsResponse--; | 178 buildCounterBatchGetAmpUrlsResponse--; |
179 } | 179 } |
180 | 180 |
181 | 181 |
182 main() { | 182 main() { |
183 unittest.group("obj-schema-AmpUrl", () { | 183 unittest.group("obj-schema-AmpUrl", () { |
184 unittest.test("to-json--from-json", () { | 184 unittest.test("to-json--from-json", () { |
185 var o = buildAmpUrl(); | 185 var o = buildAmpUrl(); |
186 var od = new api.AmpUrl.fromJson(o.toJson()); | 186 var od = new api.AmpUrl.fromJson(o.toJson()); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 res.batchGet(arg_request).then(unittest.expectAsync(((api.BatchGetAmpUrlsR
esponse response) { | 262 res.batchGet(arg_request).then(unittest.expectAsync(((api.BatchGetAmpUrlsR
esponse response) { |
263 checkBatchGetAmpUrlsResponse(response); | 263 checkBatchGetAmpUrlsResponse(response); |
264 }))); | 264 }))); |
265 }); | 265 }); |
266 | 266 |
267 }); | 267 }); |
268 | 268 |
269 | 269 |
270 } | 270 } |
271 | 271 |
OLD | NEW |