import 'package:flutter/widgets.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'); }); }); }