Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 1 | // ignore_for_file: avoid_returning_null |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 2 | // ignore_for_file: camel_case_types |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 3 | // ignore_for_file: cascade_invocations |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 4 | // ignore_for_file: comment_references |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 5 | // ignore_for_file: file_names |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6 | // ignore_for_file: library_names |
| 7 | // ignore_for_file: lines_longer_than_80_chars |
| 8 | // ignore_for_file: non_constant_identifier_names |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 9 | // ignore_for_file: prefer_expression_function_bodies |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 10 | // ignore_for_file: prefer_final_locals |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 11 | // ignore_for_file: prefer_interpolation_to_compose_strings |
Kevin Moore | af84e10 | 2021-02-25 10:29:32 -0800 | [diff] [blame] | 12 | // ignore_for_file: prefer_single_quotes |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 13 | // ignore_for_file: unnecessary_brace_in_string_interps |
| 14 | // ignore_for_file: unnecessary_cast |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 15 | // ignore_for_file: unnecessary_lambdas |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 16 | // ignore_for_file: unnecessary_parenthesis |
| 17 | // ignore_for_file: unnecessary_string_interpolations |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 18 | // ignore_for_file: unused_local_variable |
| 19 | |
Kevin Moore | 2282df3 | 2021-01-27 19:15:24 -0800 | [diff] [blame] | 20 | import 'dart:async' as async; |
| 21 | import 'dart:convert' as convert; |
| 22 | import 'dart:core' as core; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 23 | |
Kevin Moore | 07f01b7 | 2021-04-25 17:33:47 -0700 | [diff] [blame] | 24 | import 'package:googleapis_beta/factchecktools/v1alpha1.dart' as api; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 25 | import 'package:http/http.dart' as http; |
| 26 | import 'package:test/test.dart' as unittest; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 27 | |
Kevin Moore | 2282df3 | 2021-01-27 19:15:24 -0800 | [diff] [blame] | 28 | import '../test_shared.dart'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 29 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 30 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview> |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 31 | buildUnnamed8025() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 32 | var o = <api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview>[]; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 33 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview()); |
| 34 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview()); |
| 35 | return o; |
| 36 | } |
| 37 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 38 | void checkUnnamed8025( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 39 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview> o) { |
| 40 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 41 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview( |
| 42 | o[0] as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview); |
| 43 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview( |
| 44 | o[1] as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 48 | api.GoogleFactcheckingFactchecktoolsV1alpha1Claim |
| 49 | buildGoogleFactcheckingFactchecktoolsV1alpha1Claim() { |
| 50 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1Claim(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 51 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim++; |
| 52 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 53 | o.claimDate = 'foo'; |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 54 | o.claimReview = buildUnnamed8025(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 55 | o.claimant = 'foo'; |
| 56 | o.text = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 57 | } |
| 58 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim--; |
| 59 | return o; |
| 60 | } |
| 61 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 62 | void checkGoogleFactcheckingFactchecktoolsV1alpha1Claim( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 63 | api.GoogleFactcheckingFactchecktoolsV1alpha1Claim o) { |
| 64 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim++; |
| 65 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 66 | unittest.expect( |
| 67 | o.claimDate!, |
| 68 | unittest.equals('foo'), |
| 69 | ); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 70 | checkUnnamed8025(o.claimReview!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 71 | unittest.expect( |
| 72 | o.claimant!, |
| 73 | unittest.equals('foo'), |
| 74 | ); |
| 75 | unittest.expect( |
| 76 | o.text!, |
| 77 | unittest.equals('foo'), |
| 78 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 79 | } |
| 80 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Claim--; |
| 81 | } |
| 82 | |
| 83 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 84 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor |
| 85 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor() { |
| 86 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 87 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor++; |
| 88 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 89 | o.imageUrl = 'foo'; |
| 90 | o.jobTitle = 'foo'; |
| 91 | o.name = 'foo'; |
| 92 | o.sameAs = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 93 | } |
| 94 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor--; |
| 95 | return o; |
| 96 | } |
| 97 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 98 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 99 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor o) { |
| 100 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor++; |
| 101 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 102 | unittest.expect( |
| 103 | o.imageUrl!, |
| 104 | unittest.equals('foo'), |
| 105 | ); |
| 106 | unittest.expect( |
| 107 | o.jobTitle!, |
| 108 | unittest.equals('foo'), |
| 109 | ); |
| 110 | unittest.expect( |
| 111 | o.name!, |
| 112 | unittest.equals('foo'), |
| 113 | ); |
| 114 | unittest.expect( |
| 115 | o.sameAs!, |
| 116 | unittest.equals('foo'), |
| 117 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 118 | } |
| 119 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor--; |
| 120 | } |
| 121 | |
| 122 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 123 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating |
| 124 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating() { |
| 125 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 126 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating++; |
| 127 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating < 3) { |
| 128 | o.bestRating = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 129 | o.imageUrl = 'foo'; |
| 130 | o.ratingExplanation = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 131 | o.ratingValue = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 132 | o.textualRating = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 133 | o.worstRating = 42; |
| 134 | } |
| 135 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating--; |
| 136 | return o; |
| 137 | } |
| 138 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 139 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 140 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating o) { |
| 141 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating++; |
| 142 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 143 | unittest.expect( |
| 144 | o.bestRating!, |
| 145 | unittest.equals(42), |
| 146 | ); |
| 147 | unittest.expect( |
| 148 | o.imageUrl!, |
| 149 | unittest.equals('foo'), |
| 150 | ); |
| 151 | unittest.expect( |
| 152 | o.ratingExplanation!, |
| 153 | unittest.equals('foo'), |
| 154 | ); |
| 155 | unittest.expect( |
| 156 | o.ratingValue!, |
| 157 | unittest.equals(42), |
| 158 | ); |
| 159 | unittest.expect( |
| 160 | o.textualRating!, |
| 161 | unittest.equals('foo'), |
| 162 | ); |
| 163 | unittest.expect( |
| 164 | o.worstRating!, |
| 165 | unittest.equals(42), |
| 166 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 167 | } |
| 168 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating--; |
| 169 | } |
| 170 | |
| 171 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 172 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview |
| 173 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview() { |
| 174 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 175 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview++; |
| 176 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 177 | o.languageCode = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 178 | o.publisher = buildGoogleFactcheckingFactchecktoolsV1alpha1Publisher(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 179 | o.reviewDate = 'foo'; |
| 180 | o.textualRating = 'foo'; |
| 181 | o.title = 'foo'; |
| 182 | o.url = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 183 | } |
| 184 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview--; |
| 185 | return o; |
| 186 | } |
| 187 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 188 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 189 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview o) { |
| 190 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview++; |
| 191 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 192 | unittest.expect( |
| 193 | o.languageCode!, |
| 194 | unittest.equals('foo'), |
| 195 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 196 | checkGoogleFactcheckingFactchecktoolsV1alpha1Publisher( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 197 | o.publisher! as api.GoogleFactcheckingFactchecktoolsV1alpha1Publisher); |
| 198 | unittest.expect( |
| 199 | o.reviewDate!, |
| 200 | unittest.equals('foo'), |
| 201 | ); |
| 202 | unittest.expect( |
| 203 | o.textualRating!, |
| 204 | unittest.equals('foo'), |
| 205 | ); |
| 206 | unittest.expect( |
| 207 | o.title!, |
| 208 | unittest.equals('foo'), |
| 209 | ); |
| 210 | unittest.expect( |
| 211 | o.url!, |
| 212 | unittest.equals('foo'), |
| 213 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 214 | } |
| 215 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview--; |
| 216 | } |
| 217 | |
| 218 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor = |
| 219 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 220 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor |
| 221 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor() { |
| 222 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 223 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor++; |
| 224 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor < |
| 225 | 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 226 | o.imageUrl = 'foo'; |
| 227 | o.name = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 228 | } |
| 229 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor--; |
| 230 | return o; |
| 231 | } |
| 232 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 233 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 234 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor o) { |
| 235 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor++; |
| 236 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor < |
| 237 | 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 238 | unittest.expect( |
| 239 | o.imageUrl!, |
| 240 | unittest.equals('foo'), |
| 241 | ); |
| 242 | unittest.expect( |
| 243 | o.name!, |
| 244 | unittest.equals('foo'), |
| 245 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 246 | } |
| 247 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor--; |
| 248 | } |
| 249 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 250 | core.List<core.String> buildUnnamed8026() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 251 | var o = <core.String>[]; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 252 | o.add('foo'); |
| 253 | o.add('foo'); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 254 | return o; |
| 255 | } |
| 256 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 257 | void checkUnnamed8026(core.List<core.String> o) { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 258 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 259 | unittest.expect( |
| 260 | o[0], |
| 261 | unittest.equals('foo'), |
| 262 | ); |
| 263 | unittest.expect( |
| 264 | o[1], |
| 265 | unittest.equals('foo'), |
| 266 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup = |
| 270 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 271 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup |
| 272 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup() { |
| 273 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 274 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup++; |
| 275 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup < |
| 276 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 277 | o.claimAppearances = buildUnnamed8026(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 278 | o.claimAuthor = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 279 | o.claimDate = 'foo'; |
| 280 | o.claimFirstAppearance = 'foo'; |
| 281 | o.claimLocation = 'foo'; |
| 282 | o.claimReviewed = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 283 | o.rating = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 284 | o.url = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 285 | } |
| 286 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup--; |
| 287 | return o; |
| 288 | } |
| 289 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 290 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 291 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup o) { |
| 292 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup++; |
| 293 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup < |
| 294 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 295 | checkUnnamed8026(o.claimAppearances!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 296 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor(o.claimAuthor! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 297 | as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 298 | unittest.expect( |
| 299 | o.claimDate!, |
| 300 | unittest.equals('foo'), |
| 301 | ); |
| 302 | unittest.expect( |
| 303 | o.claimFirstAppearance!, |
| 304 | unittest.equals('foo'), |
| 305 | ); |
| 306 | unittest.expect( |
| 307 | o.claimLocation!, |
| 308 | unittest.equals('foo'), |
| 309 | ); |
| 310 | unittest.expect( |
| 311 | o.claimReviewed!, |
| 312 | unittest.equals('foo'), |
| 313 | ); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 314 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 315 | o.rating! as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating); |
| 316 | unittest.expect( |
| 317 | o.url!, |
| 318 | unittest.equals('foo'), |
| 319 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 320 | } |
| 321 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup--; |
| 322 | } |
| 323 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 324 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup> |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 325 | buildUnnamed8027() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 326 | var o = <api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup>[]; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 327 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup()); |
| 328 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup()); |
| 329 | return o; |
| 330 | } |
| 331 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 332 | void checkUnnamed8027( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 333 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup> |
| 334 | o) { |
| 335 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 336 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup( |
| 337 | o[0] as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup); |
| 338 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup( |
| 339 | o[1] as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 340 | } |
| 341 | |
| 342 | core.int |
| 343 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage = |
| 344 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 345 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage |
| 346 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage() { |
| 347 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 348 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage++; |
| 349 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage < |
| 350 | 3) { |
| 351 | o.claimReviewAuthor = |
| 352 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor(); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 353 | o.claimReviewMarkups = buildUnnamed8027(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 354 | o.name = 'foo'; |
| 355 | o.pageUrl = 'foo'; |
| 356 | o.publishDate = 'foo'; |
| 357 | o.versionId = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 358 | } |
| 359 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage--; |
| 360 | return o; |
| 361 | } |
| 362 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 363 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 364 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage o) { |
| 365 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage++; |
| 366 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage < |
| 367 | 3) { |
| 368 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 369 | o.claimReviewAuthor! |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 370 | as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor); |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 371 | checkUnnamed8027(o.claimReviewMarkups!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 372 | unittest.expect( |
| 373 | o.name!, |
| 374 | unittest.equals('foo'), |
| 375 | ); |
| 376 | unittest.expect( |
| 377 | o.pageUrl!, |
| 378 | unittest.equals('foo'), |
| 379 | ); |
| 380 | unittest.expect( |
| 381 | o.publishDate!, |
| 382 | unittest.equals('foo'), |
| 383 | ); |
| 384 | unittest.expect( |
| 385 | o.versionId!, |
| 386 | unittest.equals('foo'), |
| 387 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 388 | } |
| 389 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage--; |
| 390 | } |
| 391 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 392 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1Claim> |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 393 | buildUnnamed8028() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 394 | var o = <api.GoogleFactcheckingFactchecktoolsV1alpha1Claim>[]; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 395 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1Claim()); |
| 396 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1Claim()); |
| 397 | return o; |
| 398 | } |
| 399 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 400 | void checkUnnamed8028( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 401 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1Claim> o) { |
| 402 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 403 | checkGoogleFactcheckingFactchecktoolsV1alpha1Claim( |
| 404 | o[0] as api.GoogleFactcheckingFactchecktoolsV1alpha1Claim); |
| 405 | checkGoogleFactcheckingFactchecktoolsV1alpha1Claim( |
| 406 | o[1] as api.GoogleFactcheckingFactchecktoolsV1alpha1Claim); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 407 | } |
| 408 | |
| 409 | core.int |
| 410 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse = |
| 411 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 412 | api.GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse |
| 413 | buildGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse() { |
| 414 | var o = api |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 415 | .GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse(); |
| 416 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse++; |
| 417 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse < |
| 418 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 419 | o.claims = buildUnnamed8028(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 420 | o.nextPageToken = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 421 | } |
| 422 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse--; |
| 423 | return o; |
| 424 | } |
| 425 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 426 | void checkGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 427 | api.GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse |
| 428 | o) { |
| 429 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse++; |
| 430 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse < |
| 431 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 432 | checkUnnamed8028(o.claims!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 433 | unittest.expect( |
| 434 | o.nextPageToken!, |
| 435 | unittest.equals('foo'), |
| 436 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 437 | } |
| 438 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse--; |
| 439 | } |
| 440 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 441 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage> |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 442 | buildUnnamed8029() { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 443 | var o = <api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage>[]; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 444 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage()); |
| 445 | o.add(buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage()); |
| 446 | return o; |
| 447 | } |
| 448 | |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 449 | void checkUnnamed8029( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 450 | core.List<api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage> |
| 451 | o) { |
| 452 | unittest.expect(o, unittest.hasLength(2)); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 453 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(o[0] |
| 454 | as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
| 455 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(o[1] |
| 456 | as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 457 | } |
| 458 | |
| 459 | core.int |
| 460 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse = |
| 461 | 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 462 | api.GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse |
| 463 | buildGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse() { |
| 464 | var o = api |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 465 | .GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse(); |
| 466 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse++; |
| 467 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse < |
| 468 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 469 | o.claimReviewMarkupPages = buildUnnamed8029(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 470 | o.nextPageToken = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 471 | } |
| 472 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse--; |
| 473 | return o; |
| 474 | } |
| 475 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 476 | void checkGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 477 | api.GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse |
| 478 | o) { |
| 479 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse++; |
| 480 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse < |
| 481 | 3) { |
Kevin Moore | c4e4ec8 | 2021-06-18 19:03:35 -0700 | [diff] [blame^] | 482 | checkUnnamed8029(o.claimReviewMarkupPages!); |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 483 | unittest.expect( |
| 484 | o.nextPageToken!, |
| 485 | unittest.equals('foo'), |
| 486 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 487 | } |
| 488 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse--; |
| 489 | } |
| 490 | |
| 491 | core.int buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 492 | api.GoogleFactcheckingFactchecktoolsV1alpha1Publisher |
| 493 | buildGoogleFactcheckingFactchecktoolsV1alpha1Publisher() { |
| 494 | var o = api.GoogleFactcheckingFactchecktoolsV1alpha1Publisher(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 495 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher++; |
| 496 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher < 3) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 497 | o.name = 'foo'; |
| 498 | o.site = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 499 | } |
| 500 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher--; |
| 501 | return o; |
| 502 | } |
| 503 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 504 | void checkGoogleFactcheckingFactchecktoolsV1alpha1Publisher( |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 505 | api.GoogleFactcheckingFactchecktoolsV1alpha1Publisher o) { |
| 506 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher++; |
| 507 | if (buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher < 3) { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 508 | unittest.expect( |
| 509 | o.name!, |
| 510 | unittest.equals('foo'), |
| 511 | ); |
| 512 | unittest.expect( |
| 513 | o.site!, |
| 514 | unittest.equals('foo'), |
| 515 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 516 | } |
| 517 | buildCounterGoogleFactcheckingFactchecktoolsV1alpha1Publisher--; |
| 518 | } |
| 519 | |
| 520 | core.int buildCounterGoogleProtobufEmpty = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 521 | api.GoogleProtobufEmpty buildGoogleProtobufEmpty() { |
| 522 | var o = api.GoogleProtobufEmpty(); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 523 | buildCounterGoogleProtobufEmpty++; |
| 524 | if (buildCounterGoogleProtobufEmpty < 3) {} |
| 525 | buildCounterGoogleProtobufEmpty--; |
| 526 | return o; |
| 527 | } |
| 528 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 529 | void checkGoogleProtobufEmpty(api.GoogleProtobufEmpty o) { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 530 | buildCounterGoogleProtobufEmpty++; |
| 531 | if (buildCounterGoogleProtobufEmpty < 3) {} |
| 532 | buildCounterGoogleProtobufEmpty--; |
| 533 | } |
| 534 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 535 | void main() { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 536 | unittest.group('obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1Claim', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 537 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 538 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 539 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1Claim(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 540 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 541 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1Claim.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 542 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 543 | checkGoogleFactcheckingFactchecktoolsV1alpha1Claim( |
| 544 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1Claim); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 545 | }); |
| 546 | }); |
| 547 | |
| 548 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 549 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 550 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 551 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 552 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 553 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 554 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 555 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor( |
| 556 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimAuthor); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 557 | }); |
| 558 | }); |
| 559 | |
| 560 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 561 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 562 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 563 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 564 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 565 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 566 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 567 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimRating( |
| 568 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 569 | }); |
| 570 | }); |
| 571 | |
| 572 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 573 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 574 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 575 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 576 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 577 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 578 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 579 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReview( |
| 580 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 581 | }); |
| 582 | }); |
| 583 | |
| 584 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 585 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 586 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 587 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 588 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 589 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 590 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 591 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 592 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor( |
| 593 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewAuthor); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 594 | }); |
| 595 | }); |
| 596 | |
| 597 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 598 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 599 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 600 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 601 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 602 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 603 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 604 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 605 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup( |
| 606 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkup); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 607 | }); |
| 608 | }); |
| 609 | |
| 610 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 611 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 612 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 613 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 614 | var o = |
| 615 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 616 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 617 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 618 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 619 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(od |
| 620 | as api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 621 | }); |
| 622 | }); |
| 623 | |
| 624 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 625 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 626 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 627 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 628 | var o = |
| 629 | buildGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 630 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 631 | var od = |
| 632 | api.GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 633 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 634 | checkGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 635 | od as api |
| 636 | .GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 637 | }); |
| 638 | }); |
| 639 | |
| 640 | unittest.group( |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 641 | 'obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 642 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 643 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 644 | var o = |
| 645 | buildGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 646 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 647 | var od = |
| 648 | api.GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 649 | .fromJson(oJson as core.Map<core.String, core.dynamic>); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 650 | checkGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse( |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 651 | od as api |
| 652 | .GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 653 | }); |
| 654 | }); |
| 655 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 656 | unittest.group('obj-schema-GoogleFactcheckingFactchecktoolsV1alpha1Publisher', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 657 | () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 658 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 659 | var o = buildGoogleFactcheckingFactchecktoolsV1alpha1Publisher(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 660 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 661 | var od = api.GoogleFactcheckingFactchecktoolsV1alpha1Publisher.fromJson( |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 662 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 663 | checkGoogleFactcheckingFactchecktoolsV1alpha1Publisher( |
| 664 | od as api.GoogleFactcheckingFactchecktoolsV1alpha1Publisher); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 665 | }); |
| 666 | }); |
| 667 | |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 668 | unittest.group('obj-schema-GoogleProtobufEmpty', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 669 | unittest.test('to-json--from-json', () async { |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 670 | var o = buildGoogleProtobufEmpty(); |
Kevin Moore | ae40869 | 2021-02-25 12:00:44 -0800 | [diff] [blame] | 671 | var oJson = convert.jsonDecode(convert.jsonEncode(o)); |
| 672 | var od = api.GoogleProtobufEmpty.fromJson( |
| 673 | oJson as core.Map<core.String, core.dynamic>); |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 674 | checkGoogleProtobufEmpty(od as api.GoogleProtobufEmpty); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 675 | }); |
| 676 | }); |
| 677 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 678 | unittest.group('resource-ClaimsResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 679 | unittest.test('method--search', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 680 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 681 | var res = api.FactCheckToolsApi(mock).claims; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 682 | var arg_languageCode = 'foo'; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 683 | var arg_maxAgeDays = 42; |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 684 | var arg_offset = 42; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 685 | var arg_pageSize = 42; |
| 686 | var arg_pageToken = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 687 | var arg_query = 'foo'; |
| 688 | var arg_reviewPublisherSiteFilter = 'foo'; |
| 689 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 690 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 691 | var path = (req.url).path; |
| 692 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 693 | core.int index; |
| 694 | core.String subPart; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 695 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 696 | path.substring(pathOffset, pathOffset + 1), |
| 697 | unittest.equals("/"), |
| 698 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 699 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 700 | unittest.expect( |
| 701 | path.substring(pathOffset, pathOffset + 22), |
| 702 | unittest.equals("v1alpha1/claims:search"), |
| 703 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 704 | pathOffset += 22; |
| 705 | |
| 706 | var query = (req.url).query; |
| 707 | var queryOffset = 0; |
| 708 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 709 | void addQueryParam(core.String n, core.String v) => |
| 710 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 711 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 712 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 713 | for (var part in query.split('&')) { |
| 714 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 715 | addQueryParam( |
| 716 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 717 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 718 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 719 | } |
| 720 | } |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 721 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 722 | queryMap["languageCode"]!.first, |
| 723 | unittest.equals(arg_languageCode), |
| 724 | ); |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 725 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 726 | core.int.parse(queryMap["maxAgeDays"]!.first), |
| 727 | unittest.equals(arg_maxAgeDays), |
| 728 | ); |
| 729 | unittest.expect( |
| 730 | core.int.parse(queryMap["offset"]!.first), |
| 731 | unittest.equals(arg_offset), |
| 732 | ); |
| 733 | unittest.expect( |
| 734 | core.int.parse(queryMap["pageSize"]!.first), |
| 735 | unittest.equals(arg_pageSize), |
| 736 | ); |
| 737 | unittest.expect( |
| 738 | queryMap["pageToken"]!.first, |
| 739 | unittest.equals(arg_pageToken), |
| 740 | ); |
| 741 | unittest.expect( |
| 742 | queryMap["query"]!.first, |
| 743 | unittest.equals(arg_query), |
| 744 | ); |
| 745 | unittest.expect( |
| 746 | queryMap["reviewPublisherSiteFilter"]!.first, |
| 747 | unittest.equals(arg_reviewPublisherSiteFilter), |
| 748 | ); |
| 749 | unittest.expect( |
| 750 | queryMap["fields"]!.first, |
| 751 | unittest.equals(arg_$fields), |
| 752 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 753 | |
| 754 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 755 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 756 | }; |
| 757 | var resp = convert.json.encode( |
| 758 | buildGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 759 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 760 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 761 | final response = await res.search( |
| 762 | languageCode: arg_languageCode, |
| 763 | maxAgeDays: arg_maxAgeDays, |
| 764 | offset: arg_offset, |
| 765 | pageSize: arg_pageSize, |
| 766 | pageToken: arg_pageToken, |
| 767 | query: arg_query, |
| 768 | reviewPublisherSiteFilter: arg_reviewPublisherSiteFilter, |
| 769 | $fields: arg_$fields); |
| 770 | checkGoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse( |
| 771 | response as api |
| 772 | .GoogleFactcheckingFactchecktoolsV1alpha1FactCheckedClaimSearchResponse); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 773 | }); |
| 774 | }); |
| 775 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 776 | unittest.group('resource-PagesResource', () { |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 777 | unittest.test('method--create', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 778 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 779 | var res = api.FactCheckToolsApi(mock).pages; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 780 | var arg_request = |
| 781 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 782 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 783 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 784 | var obj = |
| 785 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 786 | .fromJson(json as core.Map<core.String, core.dynamic>); |
| 787 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(obj |
| 788 | as api |
| 789 | .GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 790 | |
| 791 | var path = (req.url).path; |
| 792 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 793 | core.int index; |
| 794 | core.String subPart; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 795 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 796 | path.substring(pathOffset, pathOffset + 1), |
| 797 | unittest.equals("/"), |
| 798 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 799 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 800 | unittest.expect( |
| 801 | path.substring(pathOffset, pathOffset + 14), |
| 802 | unittest.equals("v1alpha1/pages"), |
| 803 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 804 | pathOffset += 14; |
| 805 | |
| 806 | var query = (req.url).query; |
| 807 | var queryOffset = 0; |
| 808 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 809 | void addQueryParam(core.String n, core.String v) => |
| 810 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 811 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 812 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 813 | for (var part in query.split('&')) { |
| 814 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 815 | addQueryParam( |
| 816 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 817 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 818 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 819 | } |
| 820 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 821 | unittest.expect( |
| 822 | queryMap["fields"]!.first, |
| 823 | unittest.equals(arg_$fields), |
| 824 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 825 | |
| 826 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 827 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 828 | }; |
| 829 | var resp = convert.json.encode( |
| 830 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 831 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 832 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 833 | final response = await res.create(arg_request, $fields: arg_$fields); |
| 834 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage( |
| 835 | response as api |
| 836 | .GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 837 | }); |
| 838 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 839 | unittest.test('method--delete', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 840 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 841 | var res = api.FactCheckToolsApi(mock).pages; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 842 | var arg_name = 'foo'; |
| 843 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 844 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 845 | var path = (req.url).path; |
| 846 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 847 | core.int index; |
| 848 | core.String subPart; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 849 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 850 | path.substring(pathOffset, pathOffset + 1), |
| 851 | unittest.equals("/"), |
| 852 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 853 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 854 | unittest.expect( |
| 855 | path.substring(pathOffset, pathOffset + 9), |
| 856 | unittest.equals("v1alpha1/"), |
| 857 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 858 | pathOffset += 9; |
| 859 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 860 | |
| 861 | var query = (req.url).query; |
| 862 | var queryOffset = 0; |
| 863 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 864 | void addQueryParam(core.String n, core.String v) => |
| 865 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 866 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 867 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 868 | for (var part in query.split('&')) { |
| 869 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 870 | addQueryParam( |
| 871 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 872 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 873 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 874 | } |
| 875 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 876 | unittest.expect( |
| 877 | queryMap["fields"]!.first, |
| 878 | unittest.equals(arg_$fields), |
| 879 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 880 | |
| 881 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 882 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 883 | }; |
| 884 | var resp = convert.json.encode(buildGoogleProtobufEmpty()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 885 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 886 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 887 | final response = await res.delete(arg_name, $fields: arg_$fields); |
| 888 | checkGoogleProtobufEmpty(response as api.GoogleProtobufEmpty); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 889 | }); |
| 890 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 891 | unittest.test('method--get', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 892 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 893 | var res = api.FactCheckToolsApi(mock).pages; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 894 | var arg_name = 'foo'; |
| 895 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 896 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 897 | var path = (req.url).path; |
| 898 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 899 | core.int index; |
| 900 | core.String subPart; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 901 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 902 | path.substring(pathOffset, pathOffset + 1), |
| 903 | unittest.equals("/"), |
| 904 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 905 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 906 | unittest.expect( |
| 907 | path.substring(pathOffset, pathOffset + 9), |
| 908 | unittest.equals("v1alpha1/"), |
| 909 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 910 | pathOffset += 9; |
| 911 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 912 | |
| 913 | var query = (req.url).query; |
| 914 | var queryOffset = 0; |
| 915 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 916 | void addQueryParam(core.String n, core.String v) => |
| 917 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 918 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 919 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 920 | for (var part in query.split('&')) { |
| 921 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 922 | addQueryParam( |
| 923 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 924 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 925 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 926 | } |
| 927 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 928 | unittest.expect( |
| 929 | queryMap["fields"]!.first, |
| 930 | unittest.equals(arg_$fields), |
| 931 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 932 | |
| 933 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 934 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 935 | }; |
| 936 | var resp = convert.json.encode( |
| 937 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 938 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 939 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 940 | final response = await res.get(arg_name, $fields: arg_$fields); |
| 941 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage( |
| 942 | response as api |
| 943 | .GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 944 | }); |
| 945 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 946 | unittest.test('method--list', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 947 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 948 | var res = api.FactCheckToolsApi(mock).pages; |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 949 | var arg_offset = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 950 | var arg_organization = 'foo'; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 951 | var arg_pageSize = 42; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 952 | var arg_pageToken = 'foo'; |
Kevin Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 953 | var arg_url = 'foo'; |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 954 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 955 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 956 | var path = (req.url).path; |
| 957 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 958 | core.int index; |
| 959 | core.String subPart; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 960 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 961 | path.substring(pathOffset, pathOffset + 1), |
| 962 | unittest.equals("/"), |
| 963 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 964 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 965 | unittest.expect( |
| 966 | path.substring(pathOffset, pathOffset + 14), |
| 967 | unittest.equals("v1alpha1/pages"), |
| 968 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 969 | pathOffset += 14; |
| 970 | |
| 971 | var query = (req.url).query; |
| 972 | var queryOffset = 0; |
| 973 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 974 | void addQueryParam(core.String n, core.String v) => |
| 975 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 976 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 977 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 978 | for (var part in query.split('&')) { |
| 979 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 980 | addQueryParam( |
| 981 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 982 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 983 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 984 | } |
| 985 | } |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 986 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 987 | core.int.parse(queryMap["offset"]!.first), |
| 988 | unittest.equals(arg_offset), |
| 989 | ); |
Jonas Finnemann Jensen | b223bd5 | 2020-10-09 13:02:08 +0200 | [diff] [blame] | 990 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 991 | queryMap["organization"]!.first, |
| 992 | unittest.equals(arg_organization), |
| 993 | ); |
| 994 | unittest.expect( |
| 995 | core.int.parse(queryMap["pageSize"]!.first), |
| 996 | unittest.equals(arg_pageSize), |
| 997 | ); |
| 998 | unittest.expect( |
| 999 | queryMap["pageToken"]!.first, |
| 1000 | unittest.equals(arg_pageToken), |
| 1001 | ); |
| 1002 | unittest.expect( |
| 1003 | queryMap["url"]!.first, |
| 1004 | unittest.equals(arg_url), |
| 1005 | ); |
| 1006 | unittest.expect( |
| 1007 | queryMap["fields"]!.first, |
| 1008 | unittest.equals(arg_$fields), |
| 1009 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1010 | |
| 1011 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1012 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1013 | }; |
| 1014 | var resp = convert.json.encode( |
| 1015 | buildGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1016 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1017 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1018 | final response = await res.list( |
| 1019 | offset: arg_offset, |
| 1020 | organization: arg_organization, |
| 1021 | pageSize: arg_pageSize, |
| 1022 | pageToken: arg_pageToken, |
| 1023 | url: arg_url, |
| 1024 | $fields: arg_$fields); |
| 1025 | checkGoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse( |
| 1026 | response as api |
| 1027 | .GoogleFactcheckingFactchecktoolsV1alpha1ListClaimReviewMarkupPagesResponse); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1028 | }); |
| 1029 | |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1030 | unittest.test('method--update', () async { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1031 | var mock = HttpServerMock(); |
Kevin Moore | 5889af7 | 2021-01-28 13:31:53 -0800 | [diff] [blame] | 1032 | var res = api.FactCheckToolsApi(mock).pages; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1033 | var arg_request = |
| 1034 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(); |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1035 | var arg_name = 'foo'; |
| 1036 | var arg_$fields = 'foo'; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1037 | mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1038 | var obj = |
| 1039 | api.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1040 | .fromJson(json as core.Map<core.String, core.dynamic>); |
| 1041 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage(obj |
| 1042 | as api |
| 1043 | .GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1044 | |
| 1045 | var path = (req.url).path; |
| 1046 | var pathOffset = 0; |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1047 | core.int index; |
| 1048 | core.String subPart; |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1049 | unittest.expect( |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1050 | path.substring(pathOffset, pathOffset + 1), |
| 1051 | unittest.equals("/"), |
| 1052 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1053 | pathOffset += 1; |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1054 | unittest.expect( |
| 1055 | path.substring(pathOffset, pathOffset + 9), |
| 1056 | unittest.equals("v1alpha1/"), |
| 1057 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1058 | pathOffset += 9; |
| 1059 | // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| 1060 | |
| 1061 | var query = (req.url).query; |
| 1062 | var queryOffset = 0; |
| 1063 | var queryMap = <core.String, core.List<core.String>>{}; |
Kevin Moore | 91f7e3e | 2021-01-26 07:51:20 -0800 | [diff] [blame] | 1064 | void addQueryParam(core.String n, core.String v) => |
| 1065 | queryMap.putIfAbsent(n, () => []).add(v); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1066 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1067 | if (query.isNotEmpty) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1068 | for (var part in query.split('&')) { |
| 1069 | var keyValue = part.split('='); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1070 | addQueryParam( |
| 1071 | core.Uri.decodeQueryComponent(keyValue[0]), |
| 1072 | core.Uri.decodeQueryComponent(keyValue[1]), |
| 1073 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1074 | } |
| 1075 | } |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1076 | unittest.expect( |
| 1077 | queryMap["fields"]!.first, |
| 1078 | unittest.equals(arg_$fields), |
| 1079 | ); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1080 | |
| 1081 | var h = { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1082 | 'content-type': 'application/json; charset=utf-8', |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1083 | }; |
| 1084 | var resp = convert.json.encode( |
| 1085 | buildGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage()); |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1086 | return async.Future.value(stringResponse(200, h, resp)); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1087 | }), true); |
Kevin Moore | 341348b | 2021-02-25 11:55:18 -0800 | [diff] [blame] | 1088 | final response = |
| 1089 | await res.update(arg_request, arg_name, $fields: arg_$fields); |
| 1090 | checkGoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage( |
| 1091 | response as api |
| 1092 | .GoogleFactcheckingFactchecktoolsV1alpha1ClaimReviewMarkupPage); |
Jonas Finnemann Jensen | ee696b1 | 2019-07-04 15:07:25 +0200 | [diff] [blame] | 1093 | }); |
| 1094 | }); |
| 1095 | } |