Skip to content

Commit 1210c7f

Browse files
committed
Change: Remove unnecessary await using in ThrottledDebouncer tests
1 parent 6475317 commit 1210c7f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/Tests.CodeOfChaos.Extensions/Debouncers/Throttled/ThrottledDebouncerGenericTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task ThrottledDebouncer_ShouldPassValueToCallback() {
2222
};
2323

2424
// Act
25-
await using ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 100, throttleMs: 500);
25+
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 100, throttleMs: 500);
2626
await debouncer.InvokeDebouncedAsync("test");
2727
await Task.Delay(150);
2828

@@ -42,7 +42,7 @@ public async Task ThrottledDebouncer_MultipleValues_ShouldUseLastValue() {
4242
};
4343

4444
// Act
45-
await using ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 100, throttleMs: 500);
45+
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 100, throttleMs: 500);
4646
await debouncer.InvokeDebouncedAsync("first");
4747
await debouncer.InvokeDebouncedAsync("second");
4848
await debouncer.InvokeDebouncedAsync("third");
@@ -64,7 +64,7 @@ public async Task ThrottledDebouncer_ThrottleBehavior_ShouldExecuteImmediatelyAf
6464
};
6565

6666
// Act
67-
await using ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 100, throttleMs: 200);
67+
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 100, throttleMs: 200);
6868

6969
await debouncer.InvokeDebouncedAsync("first");
7070
await Task.Delay(150); // First execution happens after debounce
@@ -227,7 +227,7 @@ public async Task ThrottledDebouncer_DefaultValues_ShouldUseDefaultDebounceAndTh
227227
};
228228

229229
// Act
230-
await using ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback); // Using defaults
230+
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback); // Using defaults
231231

232232
DateTime startTime = DateTime.UtcNow;
233233
await debouncer.InvokeDebouncedAsync("test");
@@ -253,7 +253,7 @@ public async Task ThrottledDebouncer_ZeroDebounce_ShouldExecuteImmediately() {
253253
};
254254

255255
// Act
256-
await using ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 0, throttleMs: 100);
256+
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 0, throttleMs: 100);
257257

258258
DateTime startTime = DateTime.UtcNow;
259259
await debouncer.InvokeDebouncedAsync("immediate");
@@ -289,7 +289,7 @@ public async Task ThrottledDebouncer_LongRunningCallback_ShouldNotBlockSubsequen
289289
};
290290

291291
// Act
292-
await using ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 50, throttleMs: 100);
292+
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 50, throttleMs: 100);
293293

294294
await debouncer.InvokeDebouncedAsync("slow");
295295
await Task.Delay(75); // Wait for first call to start

0 commit comments

Comments
 (0)