Skip to content

Commit ba29f70

Browse files
committed
fixup
1 parent ad6788d commit ba29f70

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Tests/ConnectionRecoveryTests.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,12 @@ public async Task NormalCloseTheStatusShouldBeCorrectAndErrorNull(bool activeRec
6161
TaskCompletionSource completion = new TaskCompletionSource();
6262
var listFromStatus = new List<State>();
6363
var listToStatus = new List<State>();
64-
var listError = new List<Error>();
64+
var listError = new List<Error?>();
6565
connection.ChangeState += (sender, from, to, error) =>
6666
{
6767
listFromStatus.Add(from);
6868
listToStatus.Add(to);
69-
if (error is not null)
70-
{
71-
listError.Add(error);
72-
}
69+
listError.Add(error);
7370
if (to == State.Closed)
7471
{
7572
completion.SetResult();
@@ -111,15 +108,12 @@ public async Task UnexpectedCloseTheStatusShouldBeCorrectAndErrorNotNull()
111108
var resetEvent = new ManualResetEvent(false);
112109
var listFromStatus = new List<State>();
113110
var listToStatus = new List<State>();
114-
var listError = new List<Error>();
111+
var listError = new List<Error?>();
115112
connection.ChangeState += (sender, previousState, currentState, error) =>
116113
{
117114
listFromStatus.Add(previousState);
118115
listToStatus.Add(currentState);
119-
if (error is not null)
120-
{
121-
listError.Add(error);
122-
}
116+
listError.Add(error);
123117
if (listError.Count >= 4)
124118
{
125119
resetEvent.Set();

0 commit comments

Comments
 (0)