OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library point_test; | 5 library point_test; |
6 | 6 |
7 import 'dart:math'; | 7 import 'dart:math'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:test/test.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 test('constructor', () { | 11 test('constructor', () { |
12 var point = new Point(0, 0); | 12 var point = new Point(0, 0); |
13 expect(point.x, 0); | 13 expect(point.x, 0); |
14 expect(point.y, 0); | 14 expect(point.y, 0); |
15 expect('$point', 'Point(0, 0)'); | 15 expect('$point', 'Point(0, 0)'); |
16 }); | 16 }); |
17 | 17 |
18 test('constructor X', () { | 18 test('constructor X', () { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 test('magnitute', () { | 81 test('magnitute', () { |
82 var a = new Point(5, 10); | 82 var a = new Point(5, 10); |
83 var b = new Point(0, 0); | 83 var b = new Point(0, 0); |
84 expect(a.magnitude, a.distanceTo(b)); | 84 expect(a.magnitude, a.distanceTo(b)); |
85 expect(b.magnitude, 0); | 85 expect(b.magnitude, 0); |
86 | 86 |
87 var c = new Point(-5, -10); | 87 var c = new Point(-5, -10); |
88 expect(c.magnitude, a.distanceTo(b)); | 88 expect(c.magnitude, a.distanceTo(b)); |
89 }); | 89 }); |
90 } | 90 } |
OLD | NEW |