Skip to content

Commit ec1a67a

Browse files
committed
Add defaults test
1 parent fc8a38b commit ec1a67a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/flutter/test/parse_client_configuration_test.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,27 @@ void main() {
3838
expect(ParseCoreData().restRetryIntervals, [100, 200, 300]);
3939
expect(ParseCoreData().restRetryIntervalsForWrites, [500, 1000]);
4040
});
41+
42+
test('testDefaultValues', () async {
43+
// arrange - initialize with only required parameters
44+
await Parse().initialize(
45+
'appId',
46+
'serverUrl',
47+
appName: 'appName',
48+
appPackageName: 'somePackageName',
49+
appVersion: 'someAppVersion',
50+
);
51+
52+
// assert - verify default values are used
53+
expect(ParseCoreData().applicationId, 'appId');
54+
expect(ParseCoreData().serverUrl, 'serverUrl');
55+
expect(ParseCoreData().debug, false); // default
56+
expect(ParseCoreData().autoSendSessionId, true); // default
57+
expect(ParseCoreData().clientKey, null); // not provided
58+
expect(ParseCoreData().masterKey, null); // not provided
59+
expect(ParseCoreData().sessionId, null); // not provided
60+
expect(ParseCoreData().liveQueryURL, null); // not provided
61+
expect(ParseCoreData().restRetryIntervals, [0, 250, 500, 1000, 2000]);
62+
expect(ParseCoreData().restRetryIntervalsForWrites, <int>[]);
63+
});
4164
}

0 commit comments

Comments
 (0)