From cc9388816ab396da00ba2c27c1a8589dc8253793 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 19 Mar 2021 18:10:25 +0530 Subject: [PATCH] test(persistence): add client constructor test in stream chat persistence client Signed-off-by: Sahil Kumar --- .../stream_chat_persistence_client_test.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/stream_chat_persistence/test/stream_chat_persistence_client_test.dart b/packages/stream_chat_persistence/test/stream_chat_persistence_client_test.dart index ef7fd020..55a5113a 100644 --- a/packages/stream_chat_persistence/test/stream_chat_persistence_client_test.dart +++ b/packages/stream_chat_persistence/test/stream_chat_persistence_client_test.dart @@ -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()), + ); + }); + + test('throws assertion error if null logLevel is provided', () { + expect( + () => StreamChatPersistenceClient(logLevel: null), + throwsA(isA()), + ); + }); + }); + group('connect', () { const userId = 'testUserId'; test('successfully connects with the Database', () async {