test(persistence): add client constructor test in stream chat persistence client
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -10,6 +10,22 @@ MoorChatDatabase _testDatabaseProvider(String userId, ConnectionMode mode) =>
|
|||||||
MoorChatDatabase.testable(userId);
|
MoorChatDatabase.testable(userId);
|
||||||
|
|
||||||
void main() {
|
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', () {
|
group('connect', () {
|
||||||
const userId = 'testUserId';
|
const userId = 'testUserId';
|
||||||
test('successfully connects with the Database', () async {
|
test('successfully connects with the Database', () async {
|
||||||
|
|||||||
Reference in New Issue
Block a user