Skip to content

Commit cd88a83

Browse files
committed
chore(all): formatted dart files
1 parent 0f709a0 commit cd88a83

File tree

1,696 files changed

+87546
-81941
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,696 files changed

+87546
-81941
lines changed

packages/amplify_datastore/test/amplify_datastore_test.dart

Lines changed: 57 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,74 @@ void main() {
1212
const mockSyncMaxRecords = 60000;
1313
const mockSyncPagesize = 1000;
1414

15-
const MethodChannel dataStoreChannel =
16-
MethodChannel('com.amazonaws.amplify/datastore');
15+
const MethodChannel dataStoreChannel = MethodChannel(
16+
'com.amazonaws.amplify/datastore',
17+
);
1718

1819
AmplifyDataStore dataStore = AmplifyDataStore(
19-
modelProvider: ModelProvider.instance,
20-
options: DataStorePluginOptions(
21-
syncExpressions: [
22-
DataStoreSyncExpression(Blog.classType, () => Blog.NAME.eq('foo')),
23-
DataStoreSyncExpression(Post.classType, () => Post.TITLE.eq('bar'))
24-
],
25-
syncInterval: mockSyncInterval,
26-
syncMaxRecords: mockSyncMaxRecords,
27-
syncPageSize: mockSyncPagesize));
20+
modelProvider: ModelProvider.instance,
21+
options: DataStorePluginOptions(
22+
syncExpressions: [
23+
DataStoreSyncExpression(Blog.classType, () => Blog.NAME.eq('foo')),
24+
DataStoreSyncExpression(Post.classType, () => Post.TITLE.eq('bar')),
25+
],
26+
syncInterval: mockSyncInterval,
27+
syncMaxRecords: mockSyncMaxRecords,
28+
syncPageSize: mockSyncPagesize,
29+
),
30+
);
2831

2932
final binding = TestWidgetsFlutterBinding.ensureInitialized();
3033

3134
tearDown(() {
32-
binding.defaultBinaryMessenger
33-
.setMockMethodCallHandler(dataStoreChannel, null);
34-
});
35-
36-
test('DataStore custom configuration should be passed via MethodChannel',
37-
() async {
38-
var expectedBlogExpression =
39-
await getJsonFromFile('sync_expressions/blog_name.json');
40-
var expectedPostExpression =
41-
await getJsonFromFile('sync_expressions/post_title.json');
4235
binding.defaultBinaryMessenger.setMockMethodCallHandler(
4336
dataStoreChannel,
44-
(MethodCall methodCall) async {
45-
if (methodCall.method == "configureDataStore") {
46-
final modelSchemas = methodCall.arguments['modelSchemas'];
47-
final syncExpressions = methodCall.arguments['syncExpressions'];
48-
final syncInterval = methodCall.arguments['syncInterval'];
49-
final syncMaxRecords = methodCall.arguments['syncMaxRecords'];
50-
final syncPageSize = methodCall.arguments['syncPageSize'];
37+
null,
38+
);
39+
});
5140

52-
expect(
41+
test(
42+
'DataStore custom configuration should be passed via MethodChannel',
43+
() async {
44+
var expectedBlogExpression = await getJsonFromFile(
45+
'sync_expressions/blog_name.json',
46+
);
47+
var expectedPostExpression = await getJsonFromFile(
48+
'sync_expressions/post_title.json',
49+
);
50+
binding.defaultBinaryMessenger.setMockMethodCallHandler(
51+
dataStoreChannel,
52+
(MethodCall methodCall) async {
53+
if (methodCall.method == "configureDataStore") {
54+
final modelSchemas = methodCall.arguments['modelSchemas'];
55+
final syncExpressions = methodCall.arguments['syncExpressions'];
56+
final syncInterval = methodCall.arguments['syncInterval'];
57+
final syncMaxRecords = methodCall.arguments['syncMaxRecords'];
58+
final syncPageSize = methodCall.arguments['syncPageSize'];
59+
60+
expect(
5361
modelSchemas,
5462
ModelProvider.instance.modelSchemas
5563
.map((schema) => schema.toMap())
56-
.toList());
57-
expect(syncExpressions.map((expression) {
58-
// Ignore generated ID
59-
(expression as Map).remove("id");
60-
return expression;
61-
}), [expectedBlogExpression, expectedPostExpression]);
62-
expect(syncInterval, mockSyncInterval);
63-
expect(syncMaxRecords, mockSyncMaxRecords);
64-
expect(syncPageSize, mockSyncPagesize);
65-
}
66-
return null;
67-
},
68-
);
64+
.toList(),
65+
);
66+
expect(
67+
syncExpressions.map((expression) {
68+
// Ignore generated ID
69+
(expression as Map).remove("id");
70+
return expression;
71+
}),
72+
[expectedBlogExpression, expectedPostExpression],
73+
);
74+
expect(syncInterval, mockSyncInterval);
75+
expect(syncMaxRecords, mockSyncMaxRecords);
76+
expect(syncPageSize, mockSyncPagesize);
77+
}
78+
return null;
79+
},
80+
);
6981

70-
await dataStore.configureDataStore();
71-
});
82+
await dataStore.configureDataStore();
83+
},
84+
);
7285
}

0 commit comments

Comments
 (0)