OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. All rights reserved. | 2 * Copyright 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style | 4 * Use of this source code is governed by a BSD-style |
5 * license that can be found in the LICENSE file or at | 5 * license that can be found in the LICENSE file or at |
6 * https://developers.google.com/open-source/licenses/bsd | 6 * https://developers.google.com/open-source/licenses/bsd |
7 */ | 7 */ |
8 library charted.test.aggregationtransformer; | 8 library charted.test.aggregationtransformer; |
9 | 9 |
10 import 'package:charted/charts/charts.dart'; | 10 import 'package:charted/charts/charts.dart'; |
11 import 'package:charted/core/utils.dart'; | 11 import 'package:charted/core/utils.dart'; |
12 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
13 import 'package:observe/observe.dart'; | 13 import 'package:observable/observable.dart'; |
14 | 14 |
15 main() { | 15 main() { |
16 List COLUMNS = [ | 16 List COLUMNS = [ |
17 new ChartColumnSpec(label:'Continent', type:ChartColumnSpec.TYPE_STRING), | 17 new ChartColumnSpec(label:'Continent', type:ChartColumnSpec.TYPE_STRING), |
18 new ChartColumnSpec(label:'Country', type:ChartColumnSpec.TYPE_STRING), | 18 new ChartColumnSpec(label:'Country', type:ChartColumnSpec.TYPE_STRING), |
19 new ChartColumnSpec(label:'City', type:ChartColumnSpec.TYPE_STRING), | 19 new ChartColumnSpec(label:'City', type:ChartColumnSpec.TYPE_STRING), |
20 new ChartColumnSpec(label:'Stats1'), | 20 new ChartColumnSpec(label:'Stats1'), |
21 new ChartColumnSpec(label:'Stats2'), | 21 new ChartColumnSpec(label:'Stats2'), |
22 new ChartColumnSpec(label:'Stats3') | 22 new ChartColumnSpec(label:'Stats3') |
23 ]; | 23 ]; |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 (observableData as Observable).deliverChanges(); | 372 (observableData as Observable).deliverChanges(); |
373 | 373 |
374 // [Argentina, , , 2000.0, 5.50] | 374 // [Argentina, , , 2000.0, 5.50] |
375 // [Brazil, , , 6000.0, 2.50] | 375 // [Brazil, , , 6000.0, 2.50] |
376 expect(result.rows.elementAt(0).elementAt(3), equals(2000)); | 376 expect(result.rows.elementAt(0).elementAt(3), equals(2000)); |
377 expect(result.rows.elementAt(0).elementAt(4), closeTo(5.5, EPSILON)); | 377 expect(result.rows.elementAt(0).elementAt(4), closeTo(5.5, EPSILON)); |
378 expect(result.rows.elementAt(1).elementAt(3), equals(6000)); | 378 expect(result.rows.elementAt(1).elementAt(3), equals(6000)); |
379 expect(result.rows.elementAt(1).elementAt(4), closeTo(1.5, EPSILON)); | 379 expect(result.rows.elementAt(1).elementAt(4), closeTo(1.5, EPSILON)); |
380 }); | 380 }); |
381 } | 381 } |
OLD | NEW |