Skip to content

Commit baf7443

Browse files
committed
test: use const for exceptions in tests
1 parent b2f6dc6 commit baf7443

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/src/ht_email_repository_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void main() {
6363

6464
test('propagates NetworkException from client', () async {
6565
// Arrange
66-
final exception = NetworkException();
66+
const exception = NetworkException();
6767
when(
6868
() => mockEmailClient.sendOtpEmail(
6969
recipientEmail: any(named: 'recipientEmail'),
@@ -92,7 +92,7 @@ void main() {
9292

9393
test('propagates InvalidInputException from client', () async {
9494
// Arrange
95-
final exception = InvalidInputException('Invalid email format');
95+
const exception = InvalidInputException('Invalid email format');
9696
when(
9797
() => mockEmailClient.sendOtpEmail(
9898
recipientEmail: any(named: 'recipientEmail'),
@@ -121,7 +121,7 @@ void main() {
121121

122122
test('propagates ServerException from client', () async {
123123
// Arrange
124-
final exception = ServerException('Email service unavailable');
124+
const exception = ServerException('Email service unavailable');
125125
when(
126126
() => mockEmailClient.sendOtpEmail(
127127
recipientEmail: any(named: 'recipientEmail'),
@@ -150,7 +150,7 @@ void main() {
150150

151151
test('propagates OperationFailedException from client', () async {
152152
// Arrange
153-
final exception = OperationFailedException('Unknown sending error');
153+
const exception = OperationFailedException('Unknown sending error');
154154
when(
155155
() => mockEmailClient.sendOtpEmail(
156156
recipientEmail: any(named: 'recipientEmail'),

0 commit comments

Comments
 (0)