Skip to content

Commit 9ba73b7

Browse files
committed
Remove TransientExceptionTypes helper and inline its usage in tests for improved maintainability.
1 parent d9674bf commit 9ba73b7

2 files changed

Lines changed: 9 additions & 49 deletions

File tree

test/unit/Elsa.Resilience.Core.UnitTests/DefaultTransientExceptionStrategyTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ public class DefaultTransientExceptionStrategyTests
66
{
77
private readonly DefaultTransientExceptionStrategy _strategy = new();
88

9-
public static TheoryData<Type> TransientExceptionTypes => new()
10-
{
9+
public static TheoryData<Type> TransientExceptionTypes =>
10+
[
1111
typeof(HttpRequestException),
1212
typeof(TimeoutException),
1313
typeof(TaskCanceledException),
1414
typeof(IOException),
1515
typeof(SocketException),
1616
typeof(EndOfStreamException)
17-
};
17+
];
1818

19-
public static TheoryData<string> TransientMessagePatterns => new()
20-
{
19+
public static TheoryData<string> TransientMessagePatterns =>
20+
[
2121
"timeout",
2222
"timed out",
2323
"connection reset",
@@ -33,14 +33,14 @@ public class DefaultTransientExceptionStrategyTests
3333
"an existing connection was forcibly closed",
3434
"TIMEOUT",
3535
"Connection Reset"
36-
};
36+
];
3737

38-
public static TheoryData<string> NonTransientMessagePatterns => new()
39-
{
38+
public static TheoryData<string> NonTransientMessagePatterns =>
39+
[
4040
"Some random error",
4141
"Invalid operation",
4242
"Null reference"
43-
};
43+
];
4444

4545
[Theory]
4646
[MemberData(nameof(TransientExceptionTypes))]

test/unit/Elsa.Resilience.Core.UnitTests/TestHelpers/TransientExceptionTypes.cs

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)