49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
import 'package:test/test.dart';
|
|
|
|
import 'package:sharedinbox/core/models/account.dart';
|
|
// Import the abstract interface so it appears in coverage.
|
|
import 'package:sharedinbox/core/repositories/account_repository.dart'; // ignore: unused_import
|
|
|
|
void main() {
|
|
group('Account', () {
|
|
const account = Account(
|
|
id: 'a1',
|
|
displayName: 'Work',
|
|
email: 'me@example.com',
|
|
imapHost: 'imap.example.com',
|
|
imapPort: 993,
|
|
imapSsl: true,
|
|
smtpHost: 'smtp.example.com',
|
|
smtpPort: 587,
|
|
smtpSsl: false,
|
|
);
|
|
|
|
test('stores all fields', () {
|
|
expect(account.id, 'a1');
|
|
expect(account.displayName, 'Work');
|
|
expect(account.email, 'me@example.com');
|
|
expect(account.imapHost, 'imap.example.com');
|
|
expect(account.imapPort, 993);
|
|
expect(account.imapSsl, isTrue);
|
|
expect(account.smtpHost, 'smtp.example.com');
|
|
expect(account.smtpPort, 587);
|
|
expect(account.smtpSsl, isFalse);
|
|
});
|
|
|
|
test('const constructor produces equal instances', () {
|
|
const same = Account(
|
|
id: 'a1',
|
|
displayName: 'Work',
|
|
email: 'me@example.com',
|
|
imapHost: 'imap.example.com',
|
|
imapPort: 993,
|
|
imapSsl: true,
|
|
smtpHost: 'smtp.example.com',
|
|
smtpPort: 587,
|
|
smtpSsl: false,
|
|
);
|
|
expect(identical(account, same), isTrue);
|
|
});
|
|
});
|
|
}
|