OLD | NEW |
1 library googleapis.adexperiencereport.v1.test; | 1 library googleapis.adexperiencereport.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:test/test.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
54 buildUnnamed1757() { | 54 buildUnnamed1774() { |
55 var o = new core.List<core.String>(); | 55 var o = new core.List<core.String>(); |
56 o.add("foo"); | 56 o.add("foo"); |
57 o.add("foo"); | 57 o.add("foo"); |
58 return o; | 58 return o; |
59 } | 59 } |
60 | 60 |
61 checkUnnamed1757(core.List<core.String> o) { | 61 checkUnnamed1774(core.List<core.String> o) { |
62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
63 unittest.expect(o[0], unittest.equals('foo')); | 63 unittest.expect(o[0], unittest.equals('foo')); |
64 unittest.expect(o[1], unittest.equals('foo')); | 64 unittest.expect(o[1], unittest.equals('foo')); |
65 } | 65 } |
66 | 66 |
67 core.int buildCounterPlatformSummary = 0; | 67 core.int buildCounterPlatformSummary = 0; |
68 buildPlatformSummary() { | 68 buildPlatformSummary() { |
69 var o = new api.PlatformSummary(); | 69 var o = new api.PlatformSummary(); |
70 buildCounterPlatformSummary++; | 70 buildCounterPlatformSummary++; |
71 if (buildCounterPlatformSummary < 3) { | 71 if (buildCounterPlatformSummary < 3) { |
| 72 o.abusiveStatus = "foo"; |
72 o.betterAdsStatus = "foo"; | 73 o.betterAdsStatus = "foo"; |
73 o.egregiousStatus = "foo"; | |
74 o.enforcementTime = "foo"; | 74 o.enforcementTime = "foo"; |
75 o.filterStatus = "foo"; | 75 o.filterStatus = "foo"; |
76 o.lastChangeTime = "foo"; | 76 o.lastChangeTime = "foo"; |
77 o.region = buildUnnamed1757(); | 77 o.region = buildUnnamed1774(); |
78 o.reportUrl = "foo"; | 78 o.reportUrl = "foo"; |
79 o.underReview = true; | 79 o.underReview = true; |
80 } | 80 } |
81 buildCounterPlatformSummary--; | 81 buildCounterPlatformSummary--; |
82 return o; | 82 return o; |
83 } | 83 } |
84 | 84 |
85 checkPlatformSummary(api.PlatformSummary o) { | 85 checkPlatformSummary(api.PlatformSummary o) { |
86 buildCounterPlatformSummary++; | 86 buildCounterPlatformSummary++; |
87 if (buildCounterPlatformSummary < 3) { | 87 if (buildCounterPlatformSummary < 3) { |
| 88 unittest.expect(o.abusiveStatus, unittest.equals('foo')); |
88 unittest.expect(o.betterAdsStatus, unittest.equals('foo')); | 89 unittest.expect(o.betterAdsStatus, unittest.equals('foo')); |
89 unittest.expect(o.egregiousStatus, unittest.equals('foo')); | |
90 unittest.expect(o.enforcementTime, unittest.equals('foo')); | 90 unittest.expect(o.enforcementTime, unittest.equals('foo')); |
91 unittest.expect(o.filterStatus, unittest.equals('foo')); | 91 unittest.expect(o.filterStatus, unittest.equals('foo')); |
92 unittest.expect(o.lastChangeTime, unittest.equals('foo')); | 92 unittest.expect(o.lastChangeTime, unittest.equals('foo')); |
93 checkUnnamed1757(o.region); | 93 checkUnnamed1774(o.region); |
94 unittest.expect(o.reportUrl, unittest.equals('foo')); | 94 unittest.expect(o.reportUrl, unittest.equals('foo')); |
95 unittest.expect(o.underReview, unittest.isTrue); | 95 unittest.expect(o.underReview, unittest.isTrue); |
96 } | 96 } |
97 buildCounterPlatformSummary--; | 97 buildCounterPlatformSummary--; |
98 } | 98 } |
99 | 99 |
100 core.int buildCounterSiteSummaryResponse = 0; | 100 core.int buildCounterSiteSummaryResponse = 0; |
101 buildSiteSummaryResponse() { | 101 buildSiteSummaryResponse() { |
102 var o = new api.SiteSummaryResponse(); | 102 var o = new api.SiteSummaryResponse(); |
103 buildCounterSiteSummaryResponse++; | 103 buildCounterSiteSummaryResponse++; |
104 if (buildCounterSiteSummaryResponse < 3) { | 104 if (buildCounterSiteSummaryResponse < 3) { |
105 o.desktopSummary = buildPlatformSummary(); | 105 o.desktopSummary = buildPlatformSummary(); |
106 o.mobileSummary = buildPlatformSummary(); | 106 o.mobileSummary = buildPlatformSummary(); |
107 o.reviewedSite = "foo"; | 107 o.reviewedSite = "foo"; |
108 } | 108 } |
109 buildCounterSiteSummaryResponse--; | 109 buildCounterSiteSummaryResponse--; |
110 return o; | 110 return o; |
111 } | 111 } |
112 | 112 |
113 checkSiteSummaryResponse(api.SiteSummaryResponse o) { | 113 checkSiteSummaryResponse(api.SiteSummaryResponse o) { |
114 buildCounterSiteSummaryResponse++; | 114 buildCounterSiteSummaryResponse++; |
115 if (buildCounterSiteSummaryResponse < 3) { | 115 if (buildCounterSiteSummaryResponse < 3) { |
116 checkPlatformSummary(o.desktopSummary); | 116 checkPlatformSummary(o.desktopSummary); |
117 checkPlatformSummary(o.mobileSummary); | 117 checkPlatformSummary(o.mobileSummary); |
118 unittest.expect(o.reviewedSite, unittest.equals('foo')); | 118 unittest.expect(o.reviewedSite, unittest.equals('foo')); |
119 } | 119 } |
120 buildCounterSiteSummaryResponse--; | 120 buildCounterSiteSummaryResponse--; |
121 } | 121 } |
122 | 122 |
123 buildUnnamed1758() { | 123 buildUnnamed1775() { |
124 var o = new core.List<api.SiteSummaryResponse>(); | 124 var o = new core.List<api.SiteSummaryResponse>(); |
125 o.add(buildSiteSummaryResponse()); | 125 o.add(buildSiteSummaryResponse()); |
126 o.add(buildSiteSummaryResponse()); | 126 o.add(buildSiteSummaryResponse()); |
127 return o; | 127 return o; |
128 } | 128 } |
129 | 129 |
130 checkUnnamed1758(core.List<api.SiteSummaryResponse> o) { | 130 checkUnnamed1775(core.List<api.SiteSummaryResponse> o) { |
131 unittest.expect(o, unittest.hasLength(2)); | 131 unittest.expect(o, unittest.hasLength(2)); |
132 checkSiteSummaryResponse(o[0]); | 132 checkSiteSummaryResponse(o[0]); |
133 checkSiteSummaryResponse(o[1]); | 133 checkSiteSummaryResponse(o[1]); |
134 } | 134 } |
135 | 135 |
136 core.int buildCounterViolatingSitesResponse = 0; | 136 core.int buildCounterViolatingSitesResponse = 0; |
137 buildViolatingSitesResponse() { | 137 buildViolatingSitesResponse() { |
138 var o = new api.ViolatingSitesResponse(); | 138 var o = new api.ViolatingSitesResponse(); |
139 buildCounterViolatingSitesResponse++; | 139 buildCounterViolatingSitesResponse++; |
140 if (buildCounterViolatingSitesResponse < 3) { | 140 if (buildCounterViolatingSitesResponse < 3) { |
141 o.violatingSites = buildUnnamed1758(); | 141 o.violatingSites = buildUnnamed1775(); |
142 } | 142 } |
143 buildCounterViolatingSitesResponse--; | 143 buildCounterViolatingSitesResponse--; |
144 return o; | 144 return o; |
145 } | 145 } |
146 | 146 |
147 checkViolatingSitesResponse(api.ViolatingSitesResponse o) { | 147 checkViolatingSitesResponse(api.ViolatingSitesResponse o) { |
148 buildCounterViolatingSitesResponse++; | 148 buildCounterViolatingSitesResponse++; |
149 if (buildCounterViolatingSitesResponse < 3) { | 149 if (buildCounterViolatingSitesResponse < 3) { |
150 checkUnnamed1758(o.violatingSites); | 150 checkUnnamed1775(o.violatingSites); |
151 } | 151 } |
152 buildCounterViolatingSitesResponse--; | 152 buildCounterViolatingSitesResponse--; |
153 } | 153 } |
154 | 154 |
155 | 155 |
156 main() { | 156 main() { |
157 unittest.group("obj-schema-PlatformSummary", () { | 157 unittest.group("obj-schema-PlatformSummary", () { |
158 unittest.test("to-json--from-json", () { | 158 unittest.test("to-json--from-json", () { |
159 var o = buildPlatformSummary(); | 159 var o = buildPlatformSummary(); |
160 var od = new api.PlatformSummary.fromJson(o.toJson()); | 160 var od = new api.PlatformSummary.fromJson(o.toJson()); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 res.list().then(unittest.expectAsync1(((api.ViolatingSitesResponse respons
e) { | 272 res.list().then(unittest.expectAsync1(((api.ViolatingSitesResponse respons
e) { |
273 checkViolatingSitesResponse(response); | 273 checkViolatingSitesResponse(response); |
274 }))); | 274 }))); |
275 }); | 275 }); |
276 | 276 |
277 }); | 277 }); |
278 | 278 |
279 | 279 |
280 } | 280 } |
281 | 281 |
OLD | NEW |