Files
farolero/test/estado_juego_host_local_test.dart
2026-04-24 20:01:54 +02:00

39 lines
918 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:farolero/estado/estado_juego.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
group('EstadoJuego host local', () {
late EstadoJuego estado;
setUp(() {
estado = EstadoJuego();
});
tearDown(() {
estado.dispose();
});
test('should start with null hostLocal', () {
expect(estado.hostLocal, isNull);
});
test('should set host jugador correctly', () {
estado.setHostJugador('Juan');
expect(estado.hostLocal, isNotNull);
expect(estado.hostLocal!.nombre, 'Juan');
expect(estado.hostLocal!.endpointId, isNull);
});
test('should update host jugador name', () {
estado.setHostJugador('Juan');
expect(estado.hostLocal!.nombre, 'Juan');
estado.setHostJugador('Maria');
expect(estado.hostLocal!.nombre, 'Maria');
});
});
}