master
neuecc 2021-02-26 10:27:22 +09:00
parent 186114996c
commit 5f96e646d4
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ namespace NetCoreTests
{ {
CancellationTokenSource cts = new CancellationTokenSource(); CancellationTokenSource cts = new CancellationTokenSource();
var v = await UniTask.Run(() => 10).WithCancellation(cts.Token); var v = await UniTask.Run(() => 10).IgnoreWhenCanceled(cts.Token);
v.Should().Be(10); v.Should().Be(10);
} }
@ -30,7 +30,7 @@ namespace NetCoreTests
{ {
await Task.Delay(TimeSpan.FromSeconds(1)); await Task.Delay(TimeSpan.FromSeconds(1));
return 10; return 10;
}).WithCancellation(cts.Token); }).IgnoreWhenCanceled(cts.Token);
cts.Cancel(); cts.Cancel();