test: 移除 TaskTest 文件

This commit is contained in:
Argo Zhang 2019-07-15 08:20:20 +08:00
parent 4eedb34906
commit 58457c25c8
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 0 additions and 47 deletions

View File

@ -1,47 +0,0 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace UnitTest
{
public class TaskTest
{
private ITestOutputHelper _helper;
public TaskTest(ITestOutputHelper helper) => _helper = helper;
[Fact]
public async void Task_Ok()
{
var cts = new CancellationTokenSource(3000);
var sw = Stopwatch.StartNew();
try
{
// await Task.Delay(3000, cts.Token);
await TestAsync(cts.Token);
}
catch (Exception) { }
finally
{
sw.Stop();
}
_helper.WriteLine(sw.ElapsedMilliseconds.ToString());
//var waiter = new CancellationTokenSource(1000);
//var task = TestAsync(waiter.Token);
//task.Wait(waiter.Token);
////try
////{
//// task.Wait(2000, waiter.Token);
////}
////catch (Exception) { }
//sw.Stop();
}
private Task TestAsync(CancellationToken token) => Task.Delay(2000, token);
}
}