File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
templates/flutter/test/src Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,11 @@ public function getFiles(): array
290
290
'destination ' => '/test/src/realtime_response_connected_test.dart ' ,
291
291
'template ' => 'flutter/test/src/realtime_response_connected_test.dart.twig ' ,
292
292
],
293
+ [
294
+ 'scope ' => 'default ' ,
295
+ 'destination ' => '/test/src/realtime_subscription_test.dart ' ,
296
+ 'template ' => 'flutter/test/src/realtime_subscription_test.dart.twig ' ,
297
+ ],
293
298
[
294
299
'scope ' => 'default ' ,
295
300
'destination ' => '/test/src/enums_test.dart ' ,
Original file line number Diff line number Diff line change
1
+ import 'package:mockito/mockito.dart';
2
+ import 'package:{{lang .params .packageName }}/src/realtime_message.dart';
3
+ import 'package:{{lang .params .packageName }}/src/realtime_subscription.dart';
4
+ import 'package:flutter_test/flutter_test.dart';
5
+
6
+ class MockStream<T > extends Mock implements Stream<T > {}
7
+
8
+
9
+
10
+ void main() {
11
+ group('RealtimeSubscription', () {
12
+ final mockStream = MockStream<RealtimeMessage >();
13
+ final mockCloseFunction = () async {};
14
+ final subscription = RealtimeSubscription(stream: mockStream, close: mockCloseFunction);
15
+
16
+ test('should have the correct stream and close function', () {
17
+ expect(subscription.stream, equals(mockStream));
18
+ expect(subscription.close, equals(mockCloseFunction));
19
+ });
20
+ });
21
+ }
You can’t perform that action at this time.
0 commit comments