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

Side by Side Diff: utils/tests/template/complex_datamodel.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/tests/string_encoding/dunit.dart ('k') | utils/tests/template/sample.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Data model for complex tests. 1 // Data model for complex tests.
2 2
3 class Person { 3 class Person {
4 String name; 4 String name;
5 int age; 5 int age;
6 List<Search> searches; 6 List<Search> searches;
7 7
8 Person(this.name, this.age, this.searches); 8 Person(this.name, this.age, this.searches);
9 } 9 }
10 10
(...skipping 15 matching lines...) Expand all
26 static int grandTotal(List<Metric> metrics) { 26 static int grandTotal(List<Metric> metrics) {
27 int total = 0; 27 int total = 0;
28 for (final metric in metrics) { 28 for (final metric in metrics) {
29 total += metric.quantity; 29 total += metric.quantity;
30 } 30 }
31 31
32 return total; 32 return total;
33 } 33 }
34 } 34 }
35 35
36 List<Person> get dataModel() { 36 List<Person> get dataModel {
37 List<Person> persons = []; 37 List<Person> persons = [];
38 38
39 List<Search> searches = []; 39 List<Search> searches = [];
40 List<Metric> metrics = []; 40 List<Metric> metrics = [];
41 41
42 // Snooki data 42 // Snooki data
43 metrics = []; 43 metrics = [];
44 metrics.add(new Metric("USA", 200300312)); 44 metrics.add(new Metric("USA", 200300312));
45 searches.add(new Search("intellect", 6, Metric.grandTotal(metrics), metrics)); 45 searches.add(new Search("intellect", 6, Metric.grandTotal(metrics), metrics));
46 46
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 metrics.add(new Metric("EU", 50)); 113 metrics.add(new Metric("EU", 50));
114 metrics.add(new Metric("Canada", 0)); 114 metrics.add(new Metric("Canada", 0));
115 metrics.add(new Metric("Mexico", 7801)); 115 metrics.add(new Metric("Mexico", 7801));
116 searches.add(new Search("tasty", 1, Metric.grandTotal(metrics), metrics)); 116 searches.add(new Search("tasty", 1, Metric.grandTotal(metrics), metrics));
117 117
118 persons.add(new Person("Uggie (Artist dog)", 10, searches)); 118 persons.add(new Person("Uggie (Artist dog)", 10, searches));
119 119
120 return persons; 120 return persons;
121 } 121 }
122 122
OLDNEW
« no previous file with comments | « utils/tests/string_encoding/dunit.dart ('k') | utils/tests/template/sample.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698