public void CreateTask_20_20() { IDisposable disposableToken = null; try { var implement = new Implement(); TaskResponse result = implement.CreateTask(20); disposableToken = result.CancelProvider; Assert.Equal(20, result.Task.Result); } finally { if (disposableToken != null) { disposableToken.Dispose(); } } }
public void GetResult_40_40() { IDisposable disposableToken = null; try { var implement = new Implement(); TaskResponse response = implement.CreateTask(40); disposableToken = response.CancelProvider; int result = implement.GetTaskResult(response.Task); Assert.Equal(40, result); } finally { if (disposableToken != null) { disposableToken.Dispose(); } } }