|
|
@ -14,13 +14,13 @@ void main() {
|
|
|
|
group('Wall', () {
|
|
|
|
group('Wall', () {
|
|
|
|
group('BallWallContactCallback', () {
|
|
|
|
group('BallWallContactCallback', () {
|
|
|
|
test(
|
|
|
|
test(
|
|
|
|
'removes the ball on begin contact when the wall is a bottom one',
|
|
|
|
'removes the ball on begin contact when the wall is a fatal one',
|
|
|
|
() {
|
|
|
|
() {
|
|
|
|
final game = MockPinballGame();
|
|
|
|
final game = MockPinballGame();
|
|
|
|
final wall = MockWall();
|
|
|
|
final wall = MockWall();
|
|
|
|
final ball = MockBall();
|
|
|
|
final ball = MockBall();
|
|
|
|
|
|
|
|
|
|
|
|
when(() => wall.type).thenReturn(WallType.bottom);
|
|
|
|
when(() => wall.type).thenReturn(WallType.fatal);
|
|
|
|
when(() => ball.gameRef).thenReturn(game);
|
|
|
|
when(() => ball.gameRef).thenReturn(game);
|
|
|
|
|
|
|
|
|
|
|
|
BallWallContactCallback()
|
|
|
|
BallWallContactCallback()
|
|
|
@ -39,7 +39,6 @@ void main() {
|
|
|
|
'loads correctly',
|
|
|
|
'loads correctly',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final wall = Wall(
|
|
|
|
final wall = Wall(
|
|
|
|
type: WallType.bottom,
|
|
|
|
|
|
|
|
start: Vector2.zero(),
|
|
|
|
start: Vector2.zero(),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -54,7 +53,6 @@ void main() {
|
|
|
|
'positions correctly',
|
|
|
|
'positions correctly',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final wall = Wall(
|
|
|
|
final wall = Wall(
|
|
|
|
type: WallType.top,
|
|
|
|
|
|
|
|
start: Vector2.zero(),
|
|
|
|
start: Vector2.zero(),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -69,7 +67,6 @@ void main() {
|
|
|
|
'is static',
|
|
|
|
'is static',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final wall = Wall(
|
|
|
|
final wall = Wall(
|
|
|
|
type: WallType.top,
|
|
|
|
|
|
|
|
start: Vector2.zero(),
|
|
|
|
start: Vector2.zero(),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -85,7 +82,6 @@ void main() {
|
|
|
|
'exists',
|
|
|
|
'exists',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final wall = Wall(
|
|
|
|
final wall = Wall(
|
|
|
|
type: WallType.top,
|
|
|
|
|
|
|
|
start: Vector2.zero(),
|
|
|
|
start: Vector2.zero(),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -99,7 +95,6 @@ void main() {
|
|
|
|
'has restitution equals 0',
|
|
|
|
'has restitution equals 0',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final wall = Wall(
|
|
|
|
final wall = Wall(
|
|
|
|
type: WallType.top,
|
|
|
|
|
|
|
|
start: Vector2.zero(),
|
|
|
|
start: Vector2.zero(),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -114,7 +109,6 @@ void main() {
|
|
|
|
'has friction',
|
|
|
|
'has friction',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final wall = Wall(
|
|
|
|
final wall = Wall(
|
|
|
|
type: WallType.top,
|
|
|
|
|
|
|
|
start: Vector2.zero(),
|
|
|
|
start: Vector2.zero(),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
end: Vector2(100, 0),
|
|
|
|
);
|
|
|
|
);
|
|
|
|