|
|
|
@ -37,7 +37,7 @@ void main() {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('returns object with updated center when center is passed', () {
|
|
|
|
|
test('returns object with updated properties when are passed', () {
|
|
|
|
|
final arcShapeExpected = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 10,
|
|
|
|
@ -58,72 +58,5 @@ void main() {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('returns object with updated arcRadius when majorRadius is passed',
|
|
|
|
|
() {
|
|
|
|
|
final arcShapeExpected = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 12,
|
|
|
|
|
angle: 2 * math.pi,
|
|
|
|
|
rotation: 0,
|
|
|
|
|
);
|
|
|
|
|
final arcShapeCopied = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 10,
|
|
|
|
|
angle: 2 * math.pi,
|
|
|
|
|
rotation: 0,
|
|
|
|
|
).copyWith(arcRadius: 12);
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < arcShapeCopied.vertices.length; index++) {
|
|
|
|
|
expect(
|
|
|
|
|
arcShapeCopied.vertices[index],
|
|
|
|
|
equals(arcShapeExpected.vertices[index]),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('returns object with updated angle when angle is passed', () {
|
|
|
|
|
final arcShapeExpected = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 10,
|
|
|
|
|
angle: 2 * math.pi,
|
|
|
|
|
rotation: 0,
|
|
|
|
|
);
|
|
|
|
|
final arcShapeCopied = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 10,
|
|
|
|
|
angle: math.pi,
|
|
|
|
|
rotation: 0,
|
|
|
|
|
).copyWith(angle: 2 * math.pi);
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < arcShapeCopied.vertices.length; index++) {
|
|
|
|
|
expect(
|
|
|
|
|
arcShapeCopied.vertices[index],
|
|
|
|
|
equals(arcShapeExpected.vertices[index]),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('returns object with updated rotation when rotation is passed', () {
|
|
|
|
|
final arcShapeExpected = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 10,
|
|
|
|
|
angle: math.pi,
|
|
|
|
|
rotation: math.pi,
|
|
|
|
|
);
|
|
|
|
|
final arcShapeCopied = ArcShape(
|
|
|
|
|
center: Vector2.all(10),
|
|
|
|
|
arcRadius: 10,
|
|
|
|
|
angle: math.pi,
|
|
|
|
|
rotation: 0,
|
|
|
|
|
).copyWith(rotation: math.pi);
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < arcShapeCopied.vertices.length; index++) {
|
|
|
|
|
expect(
|
|
|
|
|
arcShapeCopied.vertices[index],
|
|
|
|
|
equals(arcShapeExpected.vertices[index]),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|