Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
892 B

// ==========================================================================
// 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(2000, ct =>
{
called = true;
return TaskHelper.Done;
}, 2000);
timer.SkipCurrentDelay();
timer.StopAsync().Wait();
Assert.True(called);
}
}
}