File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
tests/Tests.CodeOfChaos.Extensions/Debouncers/Regular Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ namespace Tests.CodeOfChaos.Extensions.Debouncers.Regular;
1010// ---------------------------------------------------------------------------------------------------------------------
1111// ReSharper disable ConvertToLocalFunction
1212public class FuncDebouncerTests {
13+ private Lock Lock { get ; } = new ( ) ;
14+
1315 [ Test ]
1416 public async Task DefaultDebounceMs_ShouldBe100 ( ) {
1517 // Arrange
@@ -128,7 +130,9 @@ public async Task InvocationDuringDebounce_ShouldCancelPrevious_Func() {
128130 // Arrange
129131 var executionTimes = new List < DateTime > ( ) ;
130132 Func < Task > callback = ( ) => {
131- executionTimes . Add ( DateTime . UtcNow ) ;
133+ lock ( Lock ) {
134+ executionTimes . Add ( DateTime . UtcNow ) ;
135+ }
132136 return Task . CompletedTask ;
133137 } ;
134138
You can’t perform that action at this time.
0 commit comments