test: completed tests for geometry

pull/84/head
RuiAlonso 4 years ago
parent f747a12aaa
commit 1e7c0676fa

@ -37,8 +37,6 @@ List<Vector2> calculateArc({
///
/// An ellipse can be achieved by specifying a [center], a [bigRadius] and a
/// [smallRadius].
/// In addition, a semi-ellipse can be achieved by specifying its [angle] and an
/// [offsetAngle] (both in radians).
///
/// The higher the [precision], the more [Vector2]s will be calculated;
/// achieving a more rounded ellipse.

@ -52,6 +52,25 @@ void main() {
);
expect(points.length, 50);
});
test('fails if radius not in range', () {
expect(
() => calculateEllipse(
center: Vector2.zero(),
bigRadius: 100,
smallRadius: 150,
),
throwsA(isA<AssertionError>()),
);
expect(
() => calculateEllipse(
center: Vector2.zero(),
bigRadius: 100,
smallRadius: 0,
),
throwsA(isA<AssertionError>()),
);
});
});
group('calculateBezierCurve', () {

Loading…
Cancel
Save