test: unnecessary tests removed

pull/87/head
RuiAlonso 4 years ago
parent 061d2d2daf
commit 29a6cde36e

@ -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( final arcShapeExpected = ArcShape(
center: Vector2.all(10), center: Vector2.all(10),
arcRadius: 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]),
);
}
});
}); });
} }

@ -46,7 +46,7 @@ void main() {
} }
}); });
test('returns object with updated center when center is passed', () { test('returns object with updated properties when are passed', () {
final ellipseShapeExpected = EllipseShape( final ellipseShapeExpected = EllipseShape(
center: Vector2.all(10), center: Vector2.all(10),
majorRadius: 10, majorRadius: 10,
@ -67,52 +67,6 @@ void main() {
); );
} }
}); });
test('returns object with updated majorRadius when majorRadius is passed',
() {
final ellipseShapeExpected = EllipseShape(
center: Vector2.zero(),
majorRadius: 12,
minorRadius: 8,
);
final ellipseShapeCopied = EllipseShape(
center: Vector2.zero(),
majorRadius: 10,
minorRadius: 8,
).copyWith(majorRadius: 12);
for (var index = 0;
index < ellipseShapeCopied.vertices.length;
index++) {
expect(
ellipseShapeCopied.vertices[index],
equals(ellipseShapeExpected.vertices[index]),
);
}
});
test('returns object with updated minorRadius when minorRadius is passed',
() {
final ellipseShapeExpected = EllipseShape(
center: Vector2.zero(),
majorRadius: 12,
minorRadius: 5,
);
final ellipseShapeCopied = EllipseShape(
center: Vector2.zero(),
majorRadius: 12,
minorRadius: 8,
).copyWith(minorRadius: 5);
for (var index = 0;
index < ellipseShapeCopied.vertices.length;
index++) {
expect(
ellipseShapeCopied.vertices[index],
equals(ellipseShapeExpected.vertices[index]),
);
}
});
}); });
}); });
} }

Loading…
Cancel
Save