Skip to content

Commit 71a0f43

Browse files
committed
Tests: fix ScanResume
1 parent 77c690f commit 71a0f43

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

StackExchange.Redis.Tests/Scans.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,19 @@ public void ScanResume()
107107
var seq = server.Keys(DB, pageSize: 15);
108108
foreach (var key in seq)
109109
{
110-
i++;
111-
if (i < 57) continue;
112110
if (i == 57)
113111
{
114112
snapCursor = ((IScanningCursor)seq).Cursor;
115113
snapOffset = ((IScanningCursor)seq).PageOffset;
116114
snapPageSize = ((IScanningCursor)seq).PageSize;
117115
}
118-
expected.Add((string)key);
116+
if (i >= 57)
117+
{
118+
expected.Add((string)key);
119+
}
120+
i++;
119121
}
120-
Assert.NotEqual(43, expected.Count);
122+
Assert.Equal(43, expected.Count);
121123
Assert.NotEqual(0, snapCursor);
122124
Assert.Equal(11, snapOffset);
123125
Assert.Equal(15, snapPageSize);
@@ -155,7 +157,7 @@ public void ScanResume()
155157
count++;
156158
}
157159
Assert.Empty(expected);
158-
Assert.Equal(44, count); // expect the initial item to be repeated
160+
Assert.Equal(43, count);
159161
}
160162
}
161163

0 commit comments

Comments
 (0)