Skip to content

Commit bb1b792

Browse files
committed
Various fixes
1 parent fe5875b commit bb1b792

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

test/Soenneker.Utils.RateLimiting.Executor.Tests/RateLimitingExecutorTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public async Task Method1Test()
6565
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
6666
var executor = new RateLimitingExecutor(executionInterval);
6767

68-
await executor.ExecuteTask(_ => Method1(), CancellationToken);
68+
await executor.ExecuteTask(_ => Method1(), CancellationToken.None);
6969
}
7070

7171
[Test]
@@ -74,7 +74,7 @@ public async Task Method2Test()
7474
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
7575
var executor = new RateLimitingExecutor(executionInterval);
7676

77-
await executor.Execute(_ => Method2(), CancellationToken);
77+
await executor.Execute(_ => Method2(), CancellationToken.None);
7878
}
7979

8080
[Test]
@@ -83,7 +83,7 @@ public async Task Method3Test()
8383
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
8484
var executor = new RateLimitingExecutor(executionInterval);
8585

86-
string result = await executor.ExecuteTask(_ => Method3(), CancellationToken);
86+
string result = await executor.ExecuteTask(_ => Method3(), CancellationToken.None);
8787
}
8888

8989
[Test]
@@ -92,7 +92,7 @@ public async Task Method4Test()
9292
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
9393
var executor = new RateLimitingExecutor(executionInterval);
9494

95-
await executor.ExecuteTask(_ => Method4(""), CancellationToken);
95+
await executor.ExecuteTask(_ => Method4(""), CancellationToken.None);
9696
}
9797

9898
[Test]
@@ -101,7 +101,7 @@ public async Task Method5Test()
101101
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
102102
var executor = new RateLimitingExecutor(executionInterval);
103103

104-
var result = await executor.Execute(_ => Method5(""), CancellationToken);
104+
var result = await executor.Execute(_ => Method5(""), CancellationToken.None);
105105
}
106106

107107
[Test]
@@ -110,7 +110,7 @@ public async Task Method7Test()
110110
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
111111
var executor = new RateLimitingExecutor(executionInterval);
112112

113-
await executor.ExecuteTask(_ => Method7(4, 3), CancellationToken);
113+
await executor.ExecuteTask(_ => Method7(4, 3), CancellationToken.None);
114114
}
115115

116116
[Test]
@@ -119,7 +119,7 @@ public void Method8Test()
119119
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
120120
var executor = new RateLimitingExecutor(executionInterval);
121121

122-
var result = executor.Execute(Method8, CancellationToken);
122+
var result = executor.Execute(Method8, CancellationToken.None);
123123
}
124124

125125
[Test]
@@ -133,7 +133,7 @@ await executor.Execute(async token =>
133133
{
134134
taskExecuted = true;
135135
await Task.CompletedTask;
136-
}, CancellationToken);
136+
}, CancellationToken.None);
137137

138138
taskExecuted.Should().BeTrue();
139139
}
@@ -149,7 +149,7 @@ await executor.Execute(async token =>
149149
{
150150
taskExecuted = true;
151151
await Task.CompletedTask;
152-
}, CancellationToken);
152+
}, CancellationToken.None);
153153

154154
taskExecuted.Should().BeTrue();
155155

@@ -160,7 +160,7 @@ await executor.Execute(async token =>
160160
{
161161
taskExecuted = true;
162162
await Task.CompletedTask;
163-
}, CancellationToken);
163+
}, CancellationToken.None);
164164

165165
DateTime endTime = DateTime.UtcNow;
166166

@@ -176,7 +176,7 @@ public async Task Execute_ShouldThrowOperationCanceledException_WhenCancelled()
176176
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
177177
var executor = new RateLimitingExecutor(executionInterval);
178178

179-
await executor.Execute(async token => { await DelayUtil.Delay(100, null, token); }, CancellationToken);
179+
await executor.Execute(async token => { await DelayUtil.Delay(100, null, token); }, CancellationToken.None);
180180

181181
await executor.DisposeAsync();
182182

@@ -192,7 +192,7 @@ public void Execute_Action_ShouldRunWithoutDelay_WhenFirstExecution()
192192
var executor = new RateLimitingExecutor(executionInterval);
193193
var actionExecuted = false;
194194

195-
executor.Execute(token => { actionExecuted = true; }, CancellationToken);
195+
executor.Execute(token => { actionExecuted = true; }, CancellationToken.None);
196196

197197
actionExecuted.Should().BeTrue();
198198
}
@@ -203,7 +203,7 @@ public async Task DisposeAsync_ShouldCancelPendingTasks()
203203
TimeSpan executionInterval = TimeSpan.FromMilliseconds(500);
204204
var executor = new RateLimitingExecutor(executionInterval);
205205

206-
ValueTask executionTask = executor.Execute(async token => { await DelayUtil.Delay(1000, null, token); }, CancellationToken);
206+
ValueTask executionTask = executor.Execute(async token => { await DelayUtil.Delay(1000, null, token); }, CancellationToken.None);
207207

208208
await executor.DisposeAsync();
209209

0 commit comments

Comments
 (0)