From f856df538b45ffdbd54d0cdb51ac30e35adfca60 Mon Sep 17 00:00:00 2001 From: alestiago Date: Fri, 1 Apr 2022 12:57:26 +0100 Subject: [PATCH] feat: included addAll test --- test/flame/component_controller_test.dart | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/flame/component_controller_test.dart b/test/flame/component_controller_test.dart index a802a393..e1973274 100644 --- a/test/flame/component_controller_test.dart +++ b/test/flame/component_controller_test.dart @@ -52,9 +52,24 @@ void main() { final component = ControlledComponent(); final controller = TestComponentController(component); - final anotherComponent = Component(); await expectLater( - () async => controller.add(anotherComponent), + () async => controller.add(Component()), + throwsException, + ); + }, + ); + + flameTester.test( + 'throws Exception when adding multiple components', + (game) async { + final component = ControlledComponent(); + final controller = TestComponentController(component); + + await expectLater( + () async => controller.addAll([ + Component(), + Component(), + ]), throwsException, ); },