mirror of
https://github.com/Jetsparrow/antiantiswearingbot.git
synced 2026-01-20 23:16:08 +03:00
19 lines
481 B
C#
19 lines
481 B
C#
using System.Threading;
|
|
|
|
namespace Jetsparrow.Aasb.Tests.Utils;
|
|
public class FakeLifetime : IHostApplicationLifetime
|
|
{
|
|
CancellationTokenSource Started = new(), Stopping = new(), Stopped = new();
|
|
|
|
public CancellationToken ApplicationStarted => Started.Token;
|
|
|
|
public CancellationToken ApplicationStopping => Stopping.Token;
|
|
|
|
public CancellationToken ApplicationStopped => Stopped.Token;
|
|
|
|
public void StopApplication()
|
|
{
|
|
Stopping.Cancel();
|
|
}
|
|
}
|