Compare commits

...

No commits in common. "main" and "master" have entirely different histories.
main ... master

132 changed files with 107 additions and 146 deletions

View File

View File

@ -1,34 +0,0 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:pong/main.dart';
import 'package:mockito/mockito.dart'
class MockGameScreen extends Mock implements GameScreen {}
void main() {
// Test for the 'moveRacket' function
test('moveRacket', () {});
// Test for the 'moveBall' function, checking ball position updates and collision handling
test('moveBall updates ball position and handles collisions', () {
final gameScreenState = GameScreenState();
// Set the ball to an initial position
gameScreenState.ballPositionX = 50;
gameScreenState.ballPositionY = 50;
// Move the ball to the right and check the position
gameScreenState.moveBall(1.0);
expect(gameScreenState.ballPositionX, greaterThan(50));
// Move the ball down and check the position
gameScreenState.moveBall(1.0);
expect(gameScreenState.ballPositionY, greaterThan(50));
// Test collision with the walls
gameScreenState.ballPositionX = 0;
gameScreenState.ballSpeedX = -1.0;
gameScreenState.moveBall(1.0);
expect(gameScreenState.ballSpeedX, greaterThan(0));
});
}

View File

@ -1,47 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pong/main.dart';
void main() {
// Widget test for the "Berühren um zu beginnen!" message
testWidgets('Tests "Berühren um zu beginnen!"', (WidgetTester tester) async {
final tapToStart = find.text("Berühren um zu beginnen!");
// Build the widget tree with StartScreen and pump the widget tree
await tester.pumpWidget(const MaterialApp(home: StartScreen()));
// Verify that the "Berühren um zu beginnen!" text is displayed
expect(tapToStart, findsOneWidget);
});
// Widget test for the "Punkte:" message in GameScreen
testWidgets('Tests "Punkte:"', (WidgetTester tester) async {
final points = find.text("Punkte: 0");
// Build the widget tree with GameScreen and pump the widget tree
await tester.pumpWidget(const MaterialApp(home: GameScreen()));
// Verify that the "Punkte: 0" text is displayed
expect(points, findsOneWidget);
});
// Widget test for the UI of StartScreen
testWidgets('StartScreen UI Test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MaterialApp(
home: StartScreen(),
));
// Verify that the "Berühren um zu beginnen!" Text is displayed.
expect(find.text('Berühren um zu beginnen!'), findsOneWidget);
// Tap on the GestureDetector to navigate to GameScreen.
await tester.tap(find.byType(GestureDetector));
await tester.pump();
// Verify that the transition to GameScreen has occurred.
expect(find.byType(GameScreen), findsOneWidget);
});
}

View File

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 544 B

View File

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 442 B

View File

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 721 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 68 B

View File

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 68 B

View File

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 68 B

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 520 B

After

Width:  |  Height:  |  Size: 520 B

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Some files were not shown because too many files have changed in this diff Show More