Skip to content

Commit c2d7188

Browse files
author
Per Kops
committed
test: simplifying if statement in MyWorkerService
1 parent 95c2a8b commit c2d7188

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

test/Atc.Hosting.Tests/XUnitTestTypes/MyWorkerService.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ public MyWorkerService(
3131
protected override Task OnExceptionAsync(
3232
Exception exception,
3333
CancellationToken stoppingToken)
34-
{
35-
if (exception is MyWorkerException)
36-
{
37-
throw exception;
38-
}
39-
40-
return Task.CompletedTask;
41-
}
34+
=> exception is MyWorkerException
35+
? throw exception
36+
: Task.CompletedTask;
4237

4338
public override Task DoWorkAsync(
4439
CancellationToken stoppingToken)

0 commit comments

Comments
 (0)