mirror of https://github.com/Squidex/squidex.git
2 changed files with 76 additions and 27 deletions
@ -0,0 +1,34 @@ |
|||||
|
// ==========================================================================
|
||||
|
// CompletionTimerTests.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Squidex.Infrastructure.Tasks; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Squidex.Infrastructure.Timers |
||||
|
{ |
||||
|
public class CompletionTimerTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Should_invoke_once_even_with_delay() |
||||
|
{ |
||||
|
var called = false; |
||||
|
|
||||
|
var timer = new CompletionTimer(20000, ct => |
||||
|
{ |
||||
|
called = true; |
||||
|
|
||||
|
return TaskHelper.Done; |
||||
|
}, 20000); |
||||
|
|
||||
|
timer.Wakeup(); |
||||
|
timer.Dispose(); |
||||
|
|
||||
|
Assert.True(called); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue