Skip to content

Commit 009036a

Browse files
committed
Refactor: Rename test methods for clarity and adjust debounce test delays
1 parent 436c4e6 commit 009036a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tests/Tests.CodeOfChaos.Extensions.AspNetCore.Components/EventCallbacks/EventCallbackDebouncerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public async Task DefaultDebounceMs_ShouldBe100() {
4949
}
5050

5151
[Test]
52-
public async Task CustomDebounceMs_ShouldRespectSpecifiedTime() {
52+
public async Task CustomDebounceMs_ShouldRespectSpecifiedTime_EventCallback() {
5353
// Arrange
5454
int callCount = 0;
5555
EventCallback callback = EventCallback.Factory.Create(this, callback: () => {

tests/Tests.CodeOfChaos.Extensions/Debouncers/Regular/ActionDebouncerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task DefaultDebounceMs_ShouldBe100() {
3131
}
3232

3333
[Test]
34-
public async Task CustomDebounceMs_ShouldRespectSpecifiedTime() {
34+
public async Task CustomDebounceMs_ShouldRespectSpecifiedTime_Action() {
3535
// Arrange
3636
int callCount = 0;
3737

tests/Tests.CodeOfChaos.Extensions/Debouncers/Regular/FuncDebouncerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task DefaultDebounceMs_ShouldBe100() {
3030
}
3131

3232
[Test]
33-
public async Task CustomDebounceMs_ShouldRespectSpecifiedTime() {
33+
public async Task CustomDebounceMs_ShouldRespectSpecifiedTime_Func() {
3434
// Arrange
3535
int callCount = 0;
3636
Func<Task> callback = () => {
@@ -133,9 +133,9 @@ public async Task InvocationDuringDebounce_ShouldCancelPrevious_Func() {
133133
};
134134

135135
// Act
136-
await using Debouncer debouncer = Debouncer.FromDelegate(callback);
136+
await using Debouncer debouncer = Debouncer.FromDelegate(callback, debounceMs: 200);
137137
await debouncer.InvokeDebouncedAsync();
138-
await Task.Delay(50);// Wait half the debounced time
138+
await Task.Delay(50);
139139
await debouncer.InvokeDebouncedAsync();
140140
await Task.Delay(150);
141141
await debouncer.FlushAsync();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ public async Task ThrottledDebouncer_LongRunningCallback_ShouldNotBlockSubsequen
291291
ThrottledDebouncer<string> debouncer = ThrottledDebouncer<string>.FromDelegate(callback, debounceMs: 50, throttleMs: 100);
292292

293293
await debouncer.InvokeDebouncedAsync("slow");
294-
await Task.Delay(75); // Wait for first call to start
294+
await Task.Delay(500); // Wait for first call to start
295295

296296
await debouncer.InvokeDebouncedAsync("fast");
297297

298-
await Task.Delay(400); // Wait for both calls to complete
298+
await Task.Delay(500); // Wait for both calls to complete
299299
await debouncer.FlushAsync();
300300

301301
// Assert

0 commit comments

Comments
 (0)