mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Fix cancellation tests
This commit is contained in:
@@ -12,16 +12,18 @@ public class CancellationTestCommand : ICommand
|
||||
{
|
||||
try
|
||||
{
|
||||
console.Output.WriteLine("Started.");
|
||||
|
||||
await Task.Delay(
|
||||
TimeSpan.FromSeconds(3),
|
||||
console.RegisterCancellationHandler()
|
||||
);
|
||||
|
||||
console.Output.WriteLine("Completed successfully");
|
||||
console.Output.WriteLine("Completed.");
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
console.Output.WriteLine("Cancelled");
|
||||
console.Output.WriteLine("Cancelled.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user