test(persistence): add client constructor test in stream chat persistence client

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-03-19 18:10:25 +05:30
parent b570d3332a
commit cc9388816a
@@ -10,6 +10,22 @@ MoorChatDatabase _testDatabaseProvider(String userId, ConnectionMode mode) =>
MoorChatDatabase.testable(userId);
void main() {
group('client constructor', () {
test('throws assertion error if null connectionMode is provided', () {
expect(
() => StreamChatPersistenceClient(connectionMode: null),
throwsA(isA<AssertionError>()),
);
});
test('throws assertion error if null logLevel is provided', () {
expect(
() => StreamChatPersistenceClient(logLevel: null),
throwsA(isA<AssertionError>()),
);
});
});
group('connect', () {
const userId = 'testUserId';
test('successfully connects with the Database', () async {